public class SimpleAlphabet extends AbstractAlphabet implements Serializable
Annotatable.AnnotationForwarder| Modifier and Type | Field and Description |
|---|---|
protected ChangeForwarder |
annotationForwarder |
EMPTY_ALPHABET, PARSERS, SYMBOLSANNOTATION| Constructor and Description |
|---|
SimpleAlphabet() |
SimpleAlphabet(Set symbols) |
SimpleAlphabet(Set symbols,
String name) |
SimpleAlphabet(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSymbolImpl(AtomicSymbol s) |
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.
|
protected ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object.
|
String |
getName()
Get the name of the alphabet.
|
protected AtomicSymbol |
getSymbolImpl(List symL) |
Iterator |
iterator()
Retrieve an Iterator over the AtomicSymbols in this FiniteAlphabet.
|
void |
removeSymbol(Symbol s)
Remove a symbol from this alphabet.
|
void |
setName(String name)
Assign a name to the alphabet
|
int |
size()
The number of symbols in the alphabet.
|
addSymbol, contains, getAmbiguity, getAmbiguityImpl, getGapSymbol, getSymbol, getTokenization, putTokenization, readResolve, toString, validateaddChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerprotected transient ChangeForwarder annotationForwarder
public SimpleAlphabet()
public SimpleAlphabet(Set symbols)
public SimpleAlphabet(String name)
public SimpleAlphabet(Set symbols, String name)
public 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 String getName()
Alphabetpublic void setName(String name)
name - the name you wish to give this alphabetpublic Annotation getAnnotation()
AnnotatablegetAnnotation in interface Annotatablepublic int size()
FiniteAlphabetsize in interface FiniteAlphabetprotected boolean containsImpl(AtomicSymbol s)
containsImpl in class AbstractAlphabetprotected void addSymbolImpl(AtomicSymbol s) throws IllegalSymbolException, ChangeVetoException
addSymbolImpl in class AbstractAlphabetIllegalSymbolExceptionChangeVetoExceptionpublic void removeSymbol(Symbol s) throws IllegalSymbolException
FiniteAlphabetIf the symbol matches multiple AtomicSymbols, then each matching symbol it will be removed.
removeSymbol in interface FiniteAlphabets - the Symbol to removeintGotIllegalSymbolException - if the symbol is null, or if for any reason
it can't be removedpublic List getAlphabets()
AlphabetgetAlphabets in interface Alphabetprotected AtomicSymbol getSymbolImpl(List symL) throws IllegalSymbolException
getSymbolImpl in class AbstractAlphabetIllegalSymbolExceptionprotected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to
be transient and lazily instantiated. Be sure to register & unregister the
forwarder in the code that does the ChangeEvent handling in setter methods.
ChangeSupport cs = super.getChangeSupport(ct);
if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
someForwarder = new ChangeForwarder(...
this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
}
return cs;
getChangeSupport in class AbstractChangeableCopyright © 2020 BioJava. All rights reserved.