Package org.biojava.bio.seq.io
Class WordTokenization
- java.lang.Object
- 
- org.biojava.utils.Unchangeable
- 
- org.biojava.bio.seq.io.WordTokenization
 
 
- 
- All Implemented Interfaces:
- Serializable,- Annotatable,- SymbolTokenization,- Changeable
 - Direct Known Subclasses:
- CrossProductTokenization,- DoubleTokenization,- IntegerTokenization,- NameTokenization,- SubIntegerTokenization
 
 public abstract class WordTokenization extends Unchangeable implements SymbolTokenization, Serializable Base class for tokenizations which accept whitespace-separated `words'. Splits at whitespace, except when it is quoted by either double-quotes ("), brackets (), or square brackets [].- Since:
- 1.2
- Author:
- Thomas Down, Greg Cox, Keith James
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.biojava.bio.AnnotatableAnnotatable.AnnotationForwarder
 - 
Nested classes/interfaces inherited from interface org.biojava.bio.seq.io.SymbolTokenizationSymbolTokenization.TokenType
 
- 
 - 
Field Summary- 
Fields inherited from interface org.biojava.bio.AnnotatableANNOTATION
 - 
Fields inherited from interface org.biojava.bio.seq.io.SymbolTokenizationCHARACTER, FIXEDWIDTH, SEPARATED, UNKNOWN
 
- 
 - 
Constructor SummaryConstructors Constructor Description WordTokenization(Alphabet fab)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AlphabetgetAlphabet()The alphabet to which this tokenization applies.AnnotationgetAnnotation()Should return the associated annotation object.SymbolTokenization.TokenTypegetTokenType()Determine the style of tokenization represented by this object.StreamParserparseStream(SeqIOListener siol)Return an object which can parse an arbitrary character stream into symbols.protected Symbol[]parseString(String s)protected ListsplitString(String str)StringtokenizeSymbolList(SymbolList sl)Return a string representation of a list of symbols.- 
Methods inherited from class org.biojava.utils.UnchangeableaddChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.biojava.utils.ChangeableaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
 - 
Methods inherited from interface org.biojava.bio.seq.io.SymbolTokenizationparseToken, tokenizeSymbol
 
- 
 
- 
- 
- 
Constructor Detail- 
WordTokenizationpublic WordTokenization(Alphabet fab) 
 
- 
 - 
Method Detail- 
getAlphabetpublic Alphabet getAlphabet() Description copied from interface:SymbolTokenizationThe alphabet to which this tokenization applies.- Specified by:
- getAlphabetin interface- SymbolTokenization
 
 - 
getTokenTypepublic SymbolTokenization.TokenType getTokenType() Description copied from interface:SymbolTokenizationDetermine the style of tokenization represented by this object.- Specified by:
- getTokenTypein interface- SymbolTokenization
 
 - 
getAnnotationpublic Annotation getAnnotation() Description copied from interface:AnnotatableShould return the associated annotation object.- Specified by:
- getAnnotationin interface- Annotatable
- Returns:
- an Annotation object, never null
 
 - 
tokenizeSymbolListpublic String tokenizeSymbolList(SymbolList sl) throws IllegalSymbolException, IllegalAlphabetException Description copied from interface:SymbolTokenizationReturn a string representation of a list of symbols.- Specified by:
- tokenizeSymbolListin interface- SymbolTokenization
- Parameters:
- sl- A SymbolList
- Throws:
- IllegalAlphabetException- if alphabets don't match
- IllegalSymbolException
 
 - 
parseStreampublic StreamParser parseStream(SeqIOListener siol) Description copied from interface:SymbolTokenizationReturn an object which can parse an arbitrary character stream into symbols.- Specified by:
- parseStreamin interface- SymbolTokenization
- Parameters:
- siol- The listener which gets notified of parsed symbols.
 
 - 
splitStringprotected List splitString(String str) throws IllegalSymbolException - Throws:
- IllegalSymbolException
 
 - 
parseStringprotected Symbol[] parseString(String s) throws IllegalSymbolException - Throws:
- IllegalSymbolException
 
 
- 
 
-