Package org.biojava.bio.seq.io
Interface SymbolTokenization
- All Superinterfaces:
Annotatable
,Changeable
- All Known Implementing Classes:
AlternateTokenization
,CharacterTokenization
,CrossProductTokenization
,DoubleTokenization
,IntegerTokenization
,NameTokenization
,SoftMaskedAlphabet.CaseSensitiveTokenization
,SubIntegerTokenization
,WordTokenization
Encapsulate a mapping between BioJava Symbol objects and
some string representation.
- Since:
- 1.2
- Author:
- Thomas Down
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SymbolTokenization.TokenType
static final SymbolTokenization.TokenType
static final SymbolTokenization.TokenType
static final SymbolTokenization.TokenType
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
-
Method Summary
Modifier and TypeMethodDescriptionThe alphabet to which this tokenization applies.Determine the style of tokenization represented by this object.parseStream
(SeqIOListener listener) Return an object which can parse an arbitrary character stream into symbols.parseToken
(String token) Returns the symbol for a single token.tokenizeSymbol
(Symbol sym) Return a token representing a single symbol.tokenizeSymbolList
(SymbolList symList) Return a string representation of a list of symbols.Methods inherited from interface org.biojava.bio.Annotatable
getAnnotation
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
CHARACTER
-
FIXEDWIDTH
-
SEPARATED
-
UNKNOWN
-
-
Method Details
-
getAlphabet
The alphabet to which this tokenization applies. -
getTokenType
Determine the style of tokenization represented by this object. -
parseToken
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
-
parseStream
Return an object which can parse an arbitrary character stream into symbols.- Parameters:
listener
- The listener which gets notified of parsed symbols.
-
tokenizeSymbol
Return a token representing a single symbol.- Parameters:
sym
- The symbol- Throws:
IllegalSymbolException
- if the symbol isn't recognized.
-
tokenizeSymbolList
String tokenizeSymbolList(SymbolList symList) throws IllegalAlphabetException, IllegalSymbolException Return a string representation of a list of symbols.- Parameters:
symList
- A SymbolList- Throws:
IllegalAlphabetException
- if alphabets don't matchIllegalSymbolException
-