Package org.biojava.bio.dist
Class UniformDistribution
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.dist.AbstractDistribution
org.biojava.bio.dist.UniformDistribution
- All Implemented Interfaces:
Serializable,Distribution,Changeable
An implementation of an uniform distribution
- Since:
- 1.0
- Author:
- Matthew Pocock, Mark Schreiber, Thomas Down
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.dist.Distribution
Distribution.NullModelForwarder -
Field Summary
Fields inherited from class org.biojava.bio.dist.AbstractDistribution
nullModelForwarderFields inherited from interface org.biojava.bio.dist.Distribution
NULL_MODEL, WEIGHTS -
Constructor Summary
ConstructorsConstructorDescriptionUniformDistribution(FiniteAlphabet alphabet) Create a new UniformDistribution. -
Method Summary
Modifier and TypeMethodDescriptionThe alphabet from which this spectrum emits symbols.Retrieve the null model Distribution that this Distribution recognizes.protected doubleOverride this method to implement getting the weight for an atomic symbol.voidRegister an IgnoreCountsTrainer instance as the trainer for this distribution.protected voidsetNullModelImpl(Distribution nullModel) Assign a background distribution.protected voidsetWeightImpl(AtomicSymbol sym, double weight) Implement this to actually set the weight.Methods inherited from class org.biojava.bio.dist.AbstractDistribution
equals, getChangeSupport, getWeight, hashCode, sampleSymbol, setNullModel, setWeightMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
UniformDistribution
Create a new UniformDistribution.- Parameters:
alphabet- the finite alphabet to be over
-
-
Method Details
-
getAlphabet
Description copied from interface:DistributionThe alphabet from which this spectrum emits symbols.- Specified by:
getAlphabetin interfaceDistribution- Returns:
- the Alphabet associated with this spectrum
-
getNullModel
Description copied from interface:DistributionRetrieve the null model Distribution that this Distribution recognizes.- Specified by:
getNullModelin interfaceDistribution- Returns:
- the apropriate null model
-
setNullModelImpl
Assign a background distribution.- Specified by:
setNullModelImplin classAbstractDistribution- Parameters:
nullModel- the background distribution to assign- Throws:
IllegalAlphabetException- if nullModel is over an incompattible alphabet
-
getWeightImpl
Description copied from class:AbstractDistributionOverride this method to implement getting the weight for an atomic symbol. You should just do what is necessary to fetch state. All the work with exceptions and listeners will have been handled for you.- Specified by:
getWeightImplin classAbstractDistribution- Parameters:
s- the AtomicSymbol to get the weight for- Returns:
- the weight
- Throws:
IllegalSymbolException- if sym is not known
-
setWeightImpl
Description copied from class:AbstractDistributionImplement this to actually set the weight.Do not inform any listeners. This has already been done for you. Just update state.
- Specified by:
setWeightImplin classAbstractDistribution- Parameters:
sym- the AtomicSymbol to update forweight- the new weight for that symbol- Throws:
ChangeVetoException- if the change is to be prevented
-
registerWithTrainer
Description copied from class:AbstractDistributionRegister an IgnoreCountsTrainer instance as the trainer for this distribution. Override this if you wish to implement a trainable distribution.- Specified by:
registerWithTrainerin interfaceDistribution- Overrides:
registerWithTrainerin classAbstractDistribution- Parameters:
dtc- the context to register with
-