public class SingletonAlphabet extends AbstractAlphabet implements FiniteAlphabet, Serializable
Annotatable.AnnotationForwarderserialVersionUIDEMPTY_ALPHABET, PARSERS, SYMBOLSANNOTATION| Constructor and Description |
|---|
SingletonAlphabet(AtomicSymbol sym) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSymbolImpl(AtomicSymbol sym) |
protected boolean |
containsImpl(AtomicSymbol s) |
List |
getAlphabets()
Return an ordered List of the alphabets which make up a
compound alphabet.
|
Annotation |
getAnnotation()
Should return the associated annotation object.
|
String |
getName()
Get the name of the alphabet.
|
protected AtomicSymbol |
getSymbolImpl(List symList) |
SymbolTokenization |
getTokenization(String name)
Get a SymbolTokenization by name.
|
Iterator |
iterator()
Retrieve an Iterator over the AtomicSymbols in this FiniteAlphabet.
|
void |
removeSymbol(Symbol sym)
Remove a symbol from this alphabet.
|
int |
size()
The number of symbols in the alphabet.
|
addSymbol, contains, getAmbiguity, getAmbiguityImpl, getGapSymbol, getSymbol, putTokenization, readResolve, toString, validateaddChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSymbolcontains, getAmbiguity, getGapSymbol, getSymbol, validateaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SingletonAlphabet(AtomicSymbol sym)
public List getAlphabets()
AlphabetgetAlphabets in interface Alphabetprotected boolean containsImpl(AtomicSymbol s)
containsImpl in class AbstractAlphabetpublic String getName()
Alphabetpublic SymbolTokenization getTokenization(String name) throws NoSuchElementException
AlphabetGet a SymbolTokenization by name.
The parser returned is guaranteed to return Symbols and SymbolLists that conform to this alphabet.
Every alphabet should have a SymbolTokenzation under the name 'token' that uses the symbol token characters to translate a string into a SymbolList. Likewise, there should be a SymbolTokenization under the name 'name' that uses symbol names to identify symbols. Any other names may also be defined, but the behavior of the returned SymbolTokenization is not defined here.
A SymbolTokenization under the name 'default' should be defined for all sequences, that determines the behavior when printing out a sequence. Standard behavior is to define the 'token' SymbolTokenization as default if it exists, else to define the 'name' SymbolTokenization as the default, but others are possible.
getTokenization in interface AlphabetgetTokenization in class AbstractAlphabetname - the name of the parserNoSuchElementException - if the name is unknownpublic Iterator iterator()
FiniteAlphabetEach AtomicSymbol as for which this.contains(as) is true will be returned exactly once by this iterator in no specified order.
iterator in interface FiniteAlphabetpublic int size()
FiniteAlphabetsize in interface FiniteAlphabetpublic Annotation getAnnotation()
AnnotatablegetAnnotation in interface Annotatablepublic void addSymbolImpl(AtomicSymbol sym) throws IllegalSymbolException
addSymbolImpl in class AbstractAlphabetIllegalSymbolExceptionpublic void removeSymbol(Symbol sym) throws IllegalSymbolException
FiniteAlphabetIf the symbol matches multiple AtomicSymbols, then each matching symbol it will be removed.
removeSymbol in interface FiniteAlphabetsym - the Symbol to removeintGotIllegalSymbolException - if the symbol is null, or if for any reason
it can't be removedprotected AtomicSymbol getSymbolImpl(List symList) throws IllegalSymbolException
getSymbolImpl in class AbstractAlphabetIllegalSymbolExceptionCopyright © 2020 BioJava. All rights reserved.