|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.bio.dp.SimpleEmissionState
public class SimpleEmissionState
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable |
|---|
Annotatable.AnnotationForwarder |
| Field Summary | |
|---|---|
protected ChangeForwarder |
annotationForwarder
|
protected ChangeForwarder |
distForwarder
|
| Fields inherited from interface org.biojava.bio.dp.EmissionState |
|---|
ADVANCE, DISTRIBUTION |
| Fields inherited from interface org.biojava.bio.Annotatable |
|---|
ANNOTATION |
| Constructor Summary | |
|---|---|
SimpleEmissionState(String name,
Annotation ann,
int[] advance,
Distribution dis)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.biojava.utils.AbstractChangeable |
|---|
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, 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 |
| Field Detail |
|---|
protected transient ChangeForwarder annotationForwarder
protected transient ChangeForwarder distForwarder
| Constructor Detail |
|---|
public SimpleEmissionState(String name,
Annotation ann,
int[] advance,
Distribution dis)
| Method Detail |
|---|
public final Annotation getAnnotation()
Annotatable
getAnnotation in interface Annotatable
public 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 EmissionState
public final void setDistribution(Distribution dis)
throws ChangeVetoException
EmissionState
setDistribution in interface EmissionStatedis - the new Distribution to use
ChangeVetoException - if the implementation doesn't support setting
the distribution, or if the change is vetoedpublic int[] getAdvance()
EmissionState
getAdvance in interface EmissionState
public void setAdvance(int[] advance)
throws ChangeVetoException
EmissionState
setAdvance in interface EmissionStateadvance - an array of ints, specifying how many symbols are consumed
from each sequence
ChangeVetoException - if the implementation doesn't support setting
advance, or if the change is vetoedpublic char getToken()
public final String getName()
Symbol
getName in interface Symbolpublic final void setName(String name)
public 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 Set getBases()
public 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 AbstractChangeable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||