org.biojava.bio.dist
Class UniformDistribution

java.lang.Object
  extended byorg.biojava.utils.AbstractChangeable
      extended byorg.biojava.bio.dist.AbstractDistribution
          extended byorg.biojava.bio.dist.UniformDistribution
All Implemented Interfaces:
Changeable, Distribution, java.io.Serializable

public class UniformDistribution
extends AbstractDistribution
implements java.io.Serializable

An implementation of an uniform distribution

Author:
Matthew Pocock, Mark Schreiber, Thomas Down
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.biojava.bio.dist.Distribution
Distribution.NullModelForwarder
 
Field Summary
 
Fields inherited from class org.biojava.bio.dist.AbstractDistribution
nullModelForwarder, symbolIndices
 
Fields inherited from interface org.biojava.bio.dist.Distribution
NULL_MODEL, WEIGHTS
 
Constructor Summary
UniformDistribution(FiniteAlphabet alphabet)
           
 
Method Summary
 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)
           
 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)
           
 
Methods inherited from class org.biojava.bio.dist.AbstractDistribution
getChangeSupport, getWeight, sampleSymbol, setNullModel, setWeight
 
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
 

Constructor Detail

UniformDistribution

public UniformDistribution(FiniteAlphabet alphabet)
Method Detail

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
Assign a background distribution

Specified by:
setNullModelImpl in class AbstractDistribution
Parameters:
nullModel - the background distribution to assign
Throws:
IllegalAlphabetException

getWeightImpl

protected double getWeightImpl(AtomicSymbol s)
                        throws IllegalSymbolException
Specified by:
getWeightImpl in class AbstractDistribution
Throws:
IllegalSymbolException

setWeightImpl

protected void setWeightImpl(AtomicSymbol sym,
                             double weight)
                      throws ChangeVetoException
Specified by:
setWeightImpl in class AbstractDistribution
Throws:
ChangeVetoException

registerWithTrainer

public void registerWithTrainer(DistributionTrainerContext dtc)
Description copied from class: AbstractDistribution
Register an IgnoreCountsTrainer instance as the trainer for this distribution. Override this if you wish to implement a trainable distribution.

Specified by:
registerWithTrainer in interface Distribution
Overrides:
registerWithTrainer in class AbstractDistribution