org.biojava.bio.dist
Class SimpleDistribution
java.lang.Object
|
+--org.biojava.utils.AbstractChangeable
|
+--org.biojava.bio.dist.AbstractDistribution
|
+--org.biojava.bio.dist.SimpleDistribution
- All Implemented Interfaces:
- Changeable, Distribution, java.io.Serializable
- Direct Known Subclasses:
- UntrainableDistribution
- public class SimpleDistribution
- extends AbstractDistribution
- implements java.io.Serializable
A simple implementation of a distribution, which works with any finite alphabet.
- Author:
- Matthew Pocock, Thomas Down, Mark Schreiber
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleDistribution
public SimpleDistribution(FiniteAlphabet alphabet)
getAlphabet
public Alphabet getAlphabet()
- Description copied from interface:
Distribution
- The alphabet from which this spectrum emits symbols.
- Specified by:
getAlphabet in interface Distribution
- Returns:
- the Alphabet associated with this spectrum
getNullModel
public Distribution getNullModel()
- Description copied from interface:
Distribution
- Retrieve the null model Distribution that this Distribution recognizes.
- Specified by:
getNullModel in interface Distribution
- Returns:
- the apropriate null model
setNullModelImpl
protected void setNullModelImpl(Distribution nullModel)
throws IllegalAlphabetException,
ChangeVetoException
- Specified by:
setNullModelImpl in class AbstractDistribution
IllegalAlphabetException
ChangeVetoException
hasWeights
protected boolean hasWeights()
getWeights
protected double[] getWeights()
getWeightImpl
public double getWeightImpl(AtomicSymbol s)
throws IllegalSymbolException
- Specified by:
getWeightImpl in class AbstractDistribution
IllegalSymbolException
setWeightImpl
protected void setWeightImpl(AtomicSymbol s,
double w)
throws IllegalSymbolException,
ChangeVetoException
- Specified by:
setWeightImpl in class AbstractDistribution
IllegalSymbolException
ChangeVetoException
registerWithTrainer
public void registerWithTrainer(DistributionTrainerContext dtc)
- Register a simple trainer for this distribution.
- Specified by:
registerWithTrainer in interface Distribution- Overrides:
registerWithTrainer in class AbstractDistribution
- Parameters:
dtc - the DistributionTrainerContext with witch to register a trainer