public class SimpleDistribution extends AbstractDistribution implements Serializable
| Modifier and Type | Class and Description |
|---|---|
protected class |
SimpleDistribution.Trainer
A simple implementation of a trainer for this class.
|
Distribution.NullModelForwardernullModelForwarderNULL_MODEL, WEIGHTS| Constructor and Description |
|---|
SimpleDistribution(Distribution dist)
make an instance of SimpleDistribution with weights identical
to the specified Distribution.
|
SimpleDistribution(FiniteAlphabet alphabet)
make an instance of SimpleDistribution for the specified Alphabet.
|
| 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.
|
double |
getWeightImpl(AtomicSymbol s)
Override this method to implement getting the weight for an atomic
symbol.
|
protected double[] |
getWeights()
Get the underlying array that stores the weights.
|
protected boolean |
hasWeights()
Indicate whether the weights array has been allocated yet.
|
void |
registerWithTrainer(DistributionTrainerContext dtc)
Register an SimpleDistribution.Trainer instance as the trainer for this distribution.
|
protected void |
setNullModelImpl(Distribution nullModel)
Implement this to set the null model.
|
protected void |
setWeightImpl(AtomicSymbol s,
double w)
Implement this to actually set the weight.
|
equals, getChangeSupport, getWeight, hashCode, sampleSymbol, setNullModel, setWeightaddChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SimpleDistribution(FiniteAlphabet alphabet)
public SimpleDistribution(Distribution dist)
dist - Distribution to copy the weights from.public Alphabet getAlphabet()
DistributiongetAlphabet in interface Distributionpublic Distribution getNullModel()
DistributiongetNullModel in interface Distributionprotected void setNullModelImpl(Distribution nullModel) throws IllegalAlphabetException, ChangeVetoException
AbstractDistributionYou should not inform any change listeners in this method. All of that work has been done for you.
setNullModelImpl in class AbstractDistributionnullModel - the new null model DistributionIllegalAlphabetException - if the null model is for the wrong alphabetChangeVetoException - if your implementation wishes to block this
opperationprotected boolean hasWeights()
protected double[] getWeights()
Modifying this will modify the state of the distribution.
public double getWeightImpl(AtomicSymbol s) throws IllegalSymbolException
AbstractDistributiongetWeightImpl in class AbstractDistributions - the AtomicSymbol to get the weight forIllegalSymbolException - if sym is not knownprotected void setWeightImpl(AtomicSymbol s, double w) throws IllegalSymbolException, ChangeVetoException
AbstractDistributionDo not inform any listeners. This has already been done for you. Just update state.
setWeightImpl in class AbstractDistributions - the AtomicSymbol to update forw - the new weight for that symbolIllegalSymbolException - if the symbol is not knownChangeVetoException - if the change is to be preventedpublic void registerWithTrainer(DistributionTrainerContext dtc)
registerWithTrainer in interface DistributionregisterWithTrainer in class AbstractDistributiondtc - the context to register withCopyright © 2020 BioJava. All rights reserved.