public class SimpleEmissionState extends AbstractChangeable implements EmissionState, Serializable
Annotatable.AnnotationForwarder| Modifier and Type | Field and Description | 
|---|---|
protected ChangeForwarder | 
annotationForwarder  | 
protected ChangeForwarder | 
distForwarder  | 
ADVANCE, DISTRIBUTIONANNOTATION| Constructor and Description | 
|---|
SimpleEmissionState(String name,
                   Annotation ann,
                   int[] advance,
                   Distribution dis)  | 
| Modifier and Type | Method and Description | 
|---|---|
int[] | 
getAdvance()
Determine the number of symbols this state advances along
 one or more symbol lists. 
 | 
Annotation | 
getAnnotation()
Should return the associated annotation object. 
 | 
Set | 
getBases()  | 
protected ChangeSupport | 
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object. 
 | 
Distribution | 
getDistribution()
 Get the Distribution associated with this state. 
 | 
Alphabet | 
getMatches()
The alphabet containing the symbols matched by this ambiguity symbol. 
 | 
String | 
getName()
The long name for the symbol. 
 | 
List | 
getSymbols()
 The list of symbols that this symbol is composed from. 
 | 
char | 
getToken()  | 
void | 
registerWithTrainer(ModelTrainer trainer)
Perform any registration that is necessary with mt. 
 | 
void | 
setAdvance(int[] advance)
Set the advance array. 
 | 
void | 
setAnnotation(Annotation ann)  | 
void | 
setDistribution(Distribution dis)
Set the Distribution associated with this state. 
 | 
void | 
setName(String name)  | 
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerprotected transient ChangeForwarder annotationForwarder
protected transient ChangeForwarder distForwarder
public SimpleEmissionState(String name, Annotation ann, int[] advance, Distribution dis)
public final Annotation getAnnotation()
AnnotatablegetAnnotation in interface Annotatablepublic final void setAnnotation(Annotation ann) throws ChangeVetoException
ChangeVetoExceptionpublic final Distribution getDistribution()
EmissionStateGet the Distribution associated with this state.
If the state is to be added to an HMM, then the state's emission spectrum must be compatible with the HMM - that is, their emission alphabets must match.
getDistribution in interface EmissionStatepublic final void setDistribution(Distribution dis) throws ChangeVetoException
EmissionStatesetDistribution in interface EmissionStatedis - the new Distribution to useChangeVetoException - if the implementation doesn't support setting
         the distribution, or if the change is vetoedpublic int[] getAdvance()
EmissionStategetAdvance in interface EmissionStatepublic void setAdvance(int[] advance) throws ChangeVetoException
EmissionStatesetAdvance in interface EmissionStateadvance - an array of ints, specifying how many symbols are consumed
        from each sequenceChangeVetoException - if the implementation doesn't support setting
         advance, or if the change is vetoedpublic char getToken()
public final String getName()
Symbolpublic Alphabet getMatches()
SymbolThis alphabet contains all of, and only, the symbols matched by this symbol. For example, the symbol representing the DNA ambiguity code for W would contain the symbol for A and T from the DNA alphabet.
getMatches in interface Symbolpublic List getSymbols()
BasisSymbolThe list of symbols that this symbol is composed from.
In the usual case, this list will contain just this single symbol. In the case where a symbol represents an ordered combination of other symbols, the list will contain each of these BasisSymbols.
getSymbols in interface BasisSymbolpublic void registerWithTrainer(ModelTrainer trainer)
TrainableThis may include registering handlers for transition or emission counts, or registering other Trainable objects with the ModelTrainer.
registerWithTrainer in interface Trainabletrainer - the ModelTrainer that encapsulates the training environmentprotected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
 Your implementation of this method should have the following structure:
 
 It is usual for the forwarding listeners (someForwarder in this example) to
 be transient and lazily instantiated. Be sure to register & unregister the
 forwarder in the code that does the ChangeEvent handling in setter methods.
 ChangeSupport cs = super.getChangeSupport(ct);
 if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
   someForwarder = new ChangeForwarder(...
   this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
 }
 return cs;
 
getChangeSupport in class AbstractChangeableCopyright © 2020 BioJava. All rights reserved.