Package org.biojava.bio.symbol
Class SoftMaskedAlphabet.CaseSensitiveTokenization
- java.lang.Object
-
- org.biojava.utils.Unchangeable
-
- org.biojava.bio.symbol.SoftMaskedAlphabet.CaseSensitiveTokenization
-
- All Implemented Interfaces:
Annotatable
,SymbolTokenization
,Changeable
- Enclosing class:
- SoftMaskedAlphabet
public class SoftMaskedAlphabet.CaseSensitiveTokenization extends Unchangeable implements SymbolTokenization
ThisSymbolTokenizer
works with a delegate to softmask symbol tokenization as appropriate. It should only be used in combination with a SoftMaskedAlphabet. You will never instantiate one of these yourself.Copyright (c) 2004 Novartis Institute for Tropical Diseases
- Version:
- 1.0
- Author:
- Mark Schreiber
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Alphabet
getAlphabet()
The alphabet to which this tokenization applies.Annotation
getAnnotation()
Should return the associated annotation object.SymbolTokenization.TokenType
getTokenType()
Determine the style of tokenization represented by this object.StreamParser
parseStream(SeqIOListener l)
The current implementation only supports character parsing.Symbol
parseToken(String token)
Returns the symbol for a single token.String
tokenizeSymbol(Symbol s)
Return a token representing a single symbol.String
tokenizeSymbolList(SymbolList sl)
Return a string representation of a list of symbols.-
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
-
-
-
-
Method Detail
-
getAnnotation
public Annotation getAnnotation()
Description copied from interface:Annotatable
Should return the associated annotation object.- Specified by:
getAnnotation
in interfaceAnnotatable
- Returns:
- an Annotation object, never null
-
getAlphabet
public Alphabet getAlphabet()
Description copied from interface:SymbolTokenization
The alphabet to which this tokenization applies.- Specified by:
getAlphabet
in interfaceSymbolTokenization
-
getTokenType
public SymbolTokenization.TokenType getTokenType()
Description copied from interface:SymbolTokenization
Determine the style of tokenization represented by this object.- Specified by:
getTokenType
in interfaceSymbolTokenization
-
parseToken
public Symbol parseToken(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.
- Specified by:
parseToken
in interfaceSymbolTokenization
- 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
-
tokenizeSymbolList
public String tokenizeSymbolList(SymbolList sl) throws IllegalSymbolException
Description copied from interface:SymbolTokenization
Return a string representation of a list of symbols.- Specified by:
tokenizeSymbolList
in interfaceSymbolTokenization
- Parameters:
sl
- A SymbolList- Throws:
IllegalSymbolException
-
parseStream
public StreamParser parseStream(SeqIOListener l)
The current implementation only supports character parsing. Word or fixed width parsing is not yet supported.- Specified by:
parseStream
in interfaceSymbolTokenization
- Parameters:
l
- theSeqIOListener
to callback to.- Returns:
- a
StreamParser
that theSeqIOListener
talks to.
-
tokenizeSymbol
public String tokenizeSymbol(Symbol s) throws IllegalSymbolException
Description copied from interface:SymbolTokenization
Return a token representing a single symbol.- Specified by:
tokenizeSymbol
in interfaceSymbolTokenization
- Parameters:
s
- The symbol- Throws:
IllegalSymbolException
- if the symbol isn't recognized.
-
-