org.biojava.bio.seq.io
Class NameTokenization
java.lang.Object
org.biojava.utils.Unchangeable
org.biojava.bio.seq.io.WordTokenization
org.biojava.bio.seq.io.NameTokenization
- All Implemented Interfaces:
- Annotatable, Changeable, java.io.Serializable, SymbolTokenization
- public class NameTokenization
- extends WordTokenization
Simple implementation of SymbolTokenization which uses the `name'
field of the symbols. This class works with any non-cross-product
FiniteAlphabet, and doesn't need any extra data to be provided.
- Since:
- 1.2
- Author:
- Thomas Down
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NameTokenization
public NameTokenization(FiniteAlphabet fab,
boolean caseSensitive)
NameTokenization
public NameTokenization(FiniteAlphabet fab)
- Construct a new NameTokenization, defaulting to case-insensitive.
finalize
protected void finalize()
throws java.lang.Throwable
- Throws:
java.lang.Throwable
getNameToSymbol
protected java.util.Map getNameToSymbol()
parseToken
public Symbol parseToken(java.lang.String token)
throws IllegalSymbolException
- Description copied from interface:
SymbolTokenization
- Returns the symbol for a single token.
The Symbol will be a member of the alphabet. If the token is not recognized
as mapping to a symbol, an exception will be thrown.
- Parameters:
token
- the token to retrieve a Symbol for
- Returns:
- the Symbol for that token
- Throws:
IllegalSymbolException
- if there is no Symbol for the token
tokenizeSymbol
public java.lang.String tokenizeSymbol(Symbol s)
throws IllegalSymbolException
- Description copied from interface:
SymbolTokenization
- Return a token representing a single symbol.
- Throws:
IllegalSymbolException
- if the symbol isn't recognized.