Package org.biojava.bio.seq.io
Class CrossProductTokenization
java.lang.Object
org.biojava.utils.Unchangeable
org.biojava.bio.seq.io.WordTokenization
org.biojava.bio.seq.io.CrossProductTokenization
- All Implemented Interfaces:
Serializable
,Annotatable
,SymbolTokenization
,Changeable
Tokenization for cross-product alphabets. This class handles
the general case of tokens of the form (foo bar baz), where
each element is handled by a sub-tokenization. By default,
these will be the "name" tokenizations of each of the sub-alphabets,
but any tokenization can be used.
- Since:
- 1.2
- Author:
- Thomas Down, Greg Cox
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
Nested classes/interfaces inherited from interface org.biojava.bio.seq.io.SymbolTokenization
SymbolTokenization.TokenType
-
Field Summary
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
Fields inherited from interface org.biojava.bio.seq.io.SymbolTokenization
CHARACTER, FIXEDWIDTH, SEPARATED, UNKNOWN
-
Constructor Summary
ConstructorsConstructorDescriptionCrossProductTokenization
(Alphabet alpha) CrossProductTokenization
(Alphabet alpha, List tokenizers) -
Method Summary
Modifier and TypeMethodDescriptionparseToken
(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, tokenizeSymbolList
Methods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder
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 Details
-
CrossProductTokenization
- Throws:
BioException
-
CrossProductTokenization
-
-
Method Details
-
parseToken
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
Description copied from interface:SymbolTokenization
Return a token representing a single symbol.- Parameters:
s
- The symbol- Throws:
IllegalSymbolException
- if the symbol isn't recognized.
-