public class UniformDistribution extends AbstractDistribution implements Serializable
Distribution.NullModelForwarder
nullModelForwarder
NULL_MODEL, WEIGHTS
Constructor and Description |
---|
UniformDistribution(FiniteAlphabet alphabet)
Create a new UniformDistribution.
|
Modifier and Type | Method and Description |
---|---|
Alphabet |
getAlphabet()
The alphabet from which this spectrum emits symbols.
|
Distribution |
getNullModel()
Retrieve the null model Distribution that this Distribution recognizes.
|
protected double |
getWeightImpl(AtomicSymbol s)
Override this method to implement getting the weight for an atomic
symbol.
|
void |
registerWithTrainer(DistributionTrainerContext dtc)
Register an IgnoreCountsTrainer instance as the trainer for this
distribution.
|
protected void |
setNullModelImpl(Distribution nullModel)
Assign a background distribution.
|
protected void |
setWeightImpl(AtomicSymbol sym,
double weight)
Implement this to actually set the weight.
|
equals, getChangeSupport, getWeight, hashCode, sampleSymbol, setNullModel, setWeight
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public UniformDistribution(FiniteAlphabet alphabet)
alphabet
- the finite alphabet to be overpublic Alphabet getAlphabet()
Distribution
getAlphabet
in interface Distribution
public Distribution getNullModel()
Distribution
getNullModel
in interface Distribution
protected void setNullModelImpl(Distribution nullModel) throws IllegalAlphabetException
setNullModelImpl
in class AbstractDistribution
nullModel
- the background distribution to assignIllegalAlphabetException
- if nullModel is over an incompattible
alphabetprotected double getWeightImpl(AtomicSymbol s) throws IllegalSymbolException
AbstractDistribution
getWeightImpl
in class AbstractDistribution
s
- the AtomicSymbol to get the weight forIllegalSymbolException
- if sym is not knownprotected void setWeightImpl(AtomicSymbol sym, double weight) throws ChangeVetoException
AbstractDistribution
Do not inform any listeners. This has already been done for you. Just update state.
setWeightImpl
in class AbstractDistribution
sym
- the AtomicSymbol to update forweight
- the new weight for that symbolChangeVetoException
- if the change is to be preventedpublic void registerWithTrainer(DistributionTrainerContext dtc)
AbstractDistribution
registerWithTrainer
in interface Distribution
registerWithTrainer
in class AbstractDistribution
dtc
- the context to register withCopyright © 2014 BioJava. All rights reserved.