Class SimpleAlphabet
- All Implemented Interfaces:
Serializable,Annotatable,Alphabet,FiniteAlphabet,Changeable
- Author:
- Matthew Pocock
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder -
Field Summary
FieldsFields inherited from interface org.biojava.bio.symbol.Alphabet
EMPTY_ALPHABET, PARSERS, SYMBOLSFields inherited from interface org.biojava.bio.Annotatable
ANNOTATION -
Constructor Summary
ConstructorsConstructorDescriptionSimpleAlphabet(String name) SimpleAlphabet(Set symbols) SimpleAlphabet(Set symbols, String name) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected booleanReturn an ordered List of the alphabets which make up a compound alphabet.Should return the associated annotation object.protected ChangeSupportCalled to retrieve the ChangeSupport for this object.getName()Get the name of the alphabet.protected AtomicSymbolgetSymbolImpl(List symL) iterator()Retrieve an Iterator over the AtomicSymbols in this FiniteAlphabet.voidRemove a symbol from this alphabet.voidAssign a name to the alphabetintsize()The number of symbols in the alphabet.Methods inherited from class org.biojava.bio.symbol.AbstractAlphabet
addSymbol, contains, getAmbiguity, getAmbiguityImpl, getGapSymbol, getSymbol, getTokenization, putTokenization, readResolve, toString, validateMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
annotationForwarder
-
-
Constructor Details
-
SimpleAlphabet
public SimpleAlphabet() -
SimpleAlphabet
-
SimpleAlphabet
-
SimpleAlphabet
-
-
Method Details
-
iterator
Description copied from interface:FiniteAlphabetRetrieve an Iterator over the AtomicSymbols in this FiniteAlphabet.Each AtomicSymbol as for which this.contains(as) is true will be returned exactly once by this iterator in no specified order.
- Specified by:
iteratorin interfaceFiniteAlphabet- Returns:
- an Iterator over the contained AtomicSymbol objects
-
getName
Description copied from interface:AlphabetGet the name of the alphabet. -
setName
Assign a name to the alphabet- Parameters:
name- the name you wish to give this alphabet
-
getAnnotation
Description copied from interface:AnnotatableShould return the associated annotation object.- Specified by:
getAnnotationin interfaceAnnotatable- Returns:
- an Annotation object, never null
-
size
Description copied from interface:FiniteAlphabetThe number of symbols in the alphabet.- Specified by:
sizein interfaceFiniteAlphabet- Returns:
- the size of the alphabet
-
containsImpl
- Specified by:
containsImplin classAbstractAlphabet
-
addSymbolImpl
- Specified by:
addSymbolImplin classAbstractAlphabet- Throws:
IllegalSymbolExceptionChangeVetoException
-
removeSymbol
Description copied from interface:FiniteAlphabetRemove a symbol from this alphabet.If the symbol matches multiple AtomicSymbols, then each matching symbol it will be removed.
- Specified by:
removeSymbolin interfaceFiniteAlphabet- Parameters:
s- the Symbol to removeintGot- Throws:
IllegalSymbolException- if the symbol is null, or if for any reason it can't be removed
-
getAlphabets
Description copied from interface:AlphabetReturn an ordered List of the alphabets which make up a compound alphabet. For simple alphabets, this will return a singleton list of itself. The returned list should be immutable.- Specified by:
getAlphabetsin interfaceAlphabet- Returns:
- a List of alphabets
-
getSymbolImpl
- Specified by:
getSymbolImplin classAbstractAlphabet- Throws:
IllegalSymbolException
-
getChangeSupport
Description copied from class:AbstractChangeableCalled to retrieve the ChangeSupport for this object.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;- Overrides:
getChangeSupportin classAbstractChangeable
-