Package 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:
Serializable,Annotatable,SymbolTokenization,Changeable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarderNested classes/interfaces inherited from interface org.biojava.bio.seq.io.SymbolTokenization
SymbolTokenization.TokenType -
Field Summary
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATIONFields inherited from interface org.biojava.bio.seq.io.SymbolTokenization
CHARACTER, FIXEDWIDTH, SEPARATED, UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new NameTokenization, defaulting to case-insensitive.NameTokenization(FiniteAlphabet fab, boolean caseSensitive) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinalize()protected MapparseToken(String token) Returns the symbol for a single token.Return a token representing a single symbol.Methods inherited from class org.biojava.bio.seq.io.WordTokenization
getAlphabet, getAnnotation, getTokenType, parseStream, parseString, splitString, tokenizeSymbolListMethods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarderMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
NameTokenization
-
NameTokenization
Construct a new NameTokenization, defaulting to case-insensitive.
-
-
Method Details
-
finalize
-
getNameToSymbol
-
parseToken
Description copied from interface:SymbolTokenizationReturns 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
Description copied from interface:SymbolTokenizationReturn a token representing a single symbol.- Parameters:
s- The symbol- Throws:
IllegalSymbolException- if the symbol isn't recognized.
-