org.biojava.bio.symbol
Class SimpleAtomicSymbol

java.lang.Object
  extended by org.biojava.utils.AbstractChangeable
      extended by org.biojava.bio.symbol.AbstractSymbol
          extended by org.biojava.bio.symbol.SimpleAtomicSymbol
All Implemented Interfaces:
java.io.Serializable, Annotatable, AtomicSymbol, BasisSymbol, Symbol, Changeable

public class SimpleAtomicSymbol
extends AbstractSymbol
implements AtomicSymbol, java.io.Serializable

A basic implementation of AtomicSymbol. If you wish to construct new Symbols, you should normally do so via utility methods on AlphabetManager. This may be a useful base class for custom implementations.

Author:
Matthew Pocock
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
 
Field Summary
protected  Alphabet matches
           
protected  java.util.List symbols
           
 
Fields inherited from class org.biojava.bio.symbol.AbstractSymbol
annotationForwarder
 
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
 
Constructor Summary
protected SimpleAtomicSymbol(Annotation annotation, java.util.List syms)
           
 
Method Summary
protected  Alphabet createMatches()
           
protected  java.util.List createSymbols()
           
 Annotation getAnnotation()
          Should return the associated annotation object.
 Alphabet getMatches()
          The alphabet containing the symbols matched by this ambiguity symbol.
 java.lang.String getName()
          The long name for the symbol.
 java.util.List getSymbols()
           The list of symbols that this symbol is composed from.
 
Methods inherited from class org.biojava.bio.symbol.AbstractSymbol
getChangeSupport, toString
 
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.biojava.bio.symbol.BasisSymbol
getSymbols
 
Methods inherited from interface org.biojava.bio.symbol.Symbol
getMatches, getName
 
Methods inherited from interface org.biojava.bio.Annotatable
getAnnotation
 
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
 

Field Detail

symbols

protected java.util.List symbols

matches

protected Alphabet matches
Constructor Detail

SimpleAtomicSymbol

protected SimpleAtomicSymbol(Annotation annotation,
                             java.util.List syms)
                      throws IllegalSymbolException
Throws:
IllegalSymbolException
Method Detail

createMatches

protected Alphabet createMatches()

getSymbols

public final java.util.List getSymbols()
Description copied from interface: BasisSymbol

The list of symbols that this symbol is composed from.

In the usual case, this list will contain just this single symbol. In the case where a symbol represents an ordered combination of other symbols, the list will contain each of these BasisSymbols.

Specified by:
getSymbols in interface BasisSymbol
Returns:
the List of Symbols that this Symbol is built from

createSymbols

protected java.util.List createSymbols()

getAnnotation

public Annotation getAnnotation()
Description copied from interface: Annotatable
Should return the associated annotation object.

Specified by:
getAnnotation in interface Annotatable
Returns:
an Annotation object, never null

getMatches

public Alphabet getMatches()
Description copied from interface: Symbol
The alphabet containing the symbols matched by this ambiguity symbol.

This alphabet contains all of, and only, the symbols matched by this symbol. For example, the symbol representing the DNA ambiguity code for W would contain the symbol for A and T from the DNA alphabet.

Specified by:
getMatches in interface Symbol
Returns:
the Alphabet of symbols matched by this symbol

getName

public java.lang.String getName()
Description copied from interface: Symbol
The long name for the symbol.

Specified by:
getName in interface Symbol
Returns:
the long name