|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.biojava.bio.symbol.SimpleTranslationTable
A no-frills implementation of TranslationTable that uses a Map to map from symbols in a finite source alphabet into a target alphabet.
Constructor Summary | |
SimpleTranslationTable(FiniteAlphabet source,
Alphabet target)
Create a new translation table that will translate symbols from source to target. |
|
SimpleTranslationTable(FiniteAlphabet source,
Alphabet target,
java.util.Map transMap)
Create a new translation table that will translate symbols from source to target. |
Method Summary | |
Alphabet |
getSourceAlphabet()
The alphabet of Symbols that can be translated. |
Alphabet |
getTargetAlphabet()
The alphabet of Symbols that will be produced. |
void |
setTranslation(Symbol from,
Symbol to)
Alter the translation mapping. |
Symbol |
translate(Symbol res)
Translate a single symbol from source alphabet to the target alphabet. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SimpleTranslationTable(FiniteAlphabet source, Alphabet target)
The source alphabet must be finite, as a Map object is used to associate a source Symbol with a target Symbol. The target alphabet need not be finite.
source
- the FiniteAlphabet to translate fromtarget
- the Alphabet to translate intopublic SimpleTranslationTable(FiniteAlphabet source, Alphabet target, java.util.Map transMap)
The Map transMap should contain keys in the source alphabet with values in the target alphabet. However, this is not currently checked.
The source alphabet must be finite, as a Map object is used to associate a source Symbol with a target Symbol. The target alphabet need not be finite.
source
- the FiniteAlphabet to translate fromtarget
- the Alphabet to translate intoMethod Detail |
public Alphabet getSourceAlphabet()
public Alphabet getTargetAlphabet()
public Symbol translate(Symbol res) throws IllegalSymbolException
sym
- the Symbol to translate (member of source alphabet)public void setTranslation(Symbol from, Symbol to) throws IllegalSymbolException
from
- source Symbolto
- target Symbol to be returned by translate(from)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |