|
||||||||||
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.dist.IndexedCount
public final class IndexedCount
An encapsulation of a count over the Symbols within a FiniteAlphabet using an AlphabetIndex object.
Field Summary |
---|
Fields inherited from interface org.biojava.bio.dist.Count |
---|
COUNTS |
Constructor Summary | |
---|---|
IndexedCount(AlphabetIndex indexer)
Get a new InexedCount for an alphabet indexer. |
|
IndexedCount(FiniteAlphabet fa)
Get a new IdexedCount for an alphabet using the default indexer. |
Method Summary | |
---|---|
Alphabet |
getAlphabet()
The alphabet from which this Count is over. |
double |
getCount(AtomicSymbol s)
Return the counts for a given Symbol. |
void |
increaseCount(AtomicSymbol s,
double c)
Set the probability or odds that Symbol s is emitted by this state. |
void |
setCount(AtomicSymbol s,
double c)
Set the count for the Symbol s. |
void |
setCounts(Count c)
Set the counts in this Counts to be equal to the counts in c. |
void |
zeroCounts()
Reset all the counts to zero. |
Methods inherited from class org.biojava.utils.AbstractChangeable |
---|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, 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 |
Constructor Detail |
---|
public IndexedCount(FiniteAlphabet fa)
fa
- the FiniteAlphabet to countpublic IndexedCount(AlphabetIndex indexer)
indexer
- the AlphabetIndex used to map between symbols and indeciesMethod Detail |
---|
public Alphabet getAlphabet()
Count
getAlphabet
in interface Count
public double getCount(AtomicSymbol s) throws IllegalSymbolException
Count
getCount
in interface Count
s
- the Symbol
IllegalSymbolException
- if s is not from this Count's alphabetpublic void setCount(AtomicSymbol s, double c) throws IllegalSymbolException, ChangeVetoException
Count
setCount
in interface Count
s
- the Symbol emittedc
- the new count for the Symbol
IllegalSymbolException
- if s is not from this state's alphabet, or
if it is an ambiguity symbol and the implementation can't handle
this case
ChangeVetoException
- if this distribution does not allow counts
to be tampered with, or if one of the listeners vetoed this changepublic void increaseCount(AtomicSymbol s, double c) throws IllegalSymbolException, ChangeVetoException
Count
increaseCount
in interface Count
s
- the Symbol emittedc
- the delta to add to the count for the Symbol
IllegalSymbolException
- if s is not from this state's alphabet, or
if it is an ambiguity symbol and the implementation can't handle
this case
ChangeVetoException
- if this Count does not allow counts
to be tampered with, or if one of the listeners vetoed this changepublic void setCounts(Count c) throws IllegalAlphabetException, ChangeVetoException
Count
setCounts
in interface Count
c
- the Count object to copy the counts from
IllegalAlphabetException
- if c has a different Alphabet to this
Count
ChangeVetoException
- if this Count does not allow the counts to be
tampered with, or if one of the listeners vetoed this changepublic void zeroCounts() throws ChangeVetoException
Count
zeroCounts
in interface Count
ChangeVetoException
- if this Count does not allow the counts to be
tampered with, or if one of the listeners vetoed this change
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |