|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.biojava.bio.symbol.FixedWidthParser
A parser that uses a fixed width window of characters to look up the associated symbol.
The string will be chunked up into substrings the size of the window, and each substring will be converted into a Symbol object.
Constructor Summary | |
FixedWidthParser(Alphabet alpha,
int tokenLength)
|
Method Summary | |
void |
addTokenMap(java.lang.String token,
Symbol symbol)
Maps a string (one or more characters) onto a symbol |
Alphabet |
getAlphabet()
The alphabet that all Symbols produced will belong to. |
SymbolList |
parse(java.lang.String seq)
Parse an entire string into a SymbolList. |
Symbol |
parseToken(java.lang.String token)
Returns the symbol for a single token. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FixedWidthParser(Alphabet alpha, int tokenLength)
Method Detail |
public Alphabet getAlphabet()
public SymbolList parse(java.lang.String seq) throws IllegalSymbolException
The SymbolList produced will have the same Alphabet as this SymbolParser.
seq
- the String to parsepublic Symbol parseToken(java.lang.String token) throws IllegalSymbolException
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.
token
- the token to retrieve a Symbol forpublic void addTokenMap(java.lang.String token, Symbol symbol) throws IllegalSymbolException, java.lang.IllegalArgumentException
token
- the string to be mappedsymbol
- the symbol to be mapped onto
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |