## org.biojava.bio.symbol
Class IntegerAlphabet.SubIntegerAlphabet

    java.lang.Object
      org.biojava.utils.AbstractChangeable
          org.biojava.bio.symbol.AbstractAlphabet
              org.biojava.bio.symbol.IntegerAlphabet.SubIntegerAlphabet

All Implemented Interfaces:
  Alphabet, Annotatable, Changeable, FiniteAlphabet, java.io.Serializable

Enclosing class:
  IntegerAlphabet

public static class IntegerAlphabet.SubIntegerAlphabet
extends AbstractAlphabet

A class to represent a finite contiguous subset of the infinite IntegerAlphabet

Since:
  1.3
Author:
  Mark Schreiber, Matthew Pocock
See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class org.biojava.bio.Annotatable
`Annotatable.AnnotationForwarder`

Field Summary

Fields inherited from interface org.biojava.bio.symbol.Alphabet
`EMPTY_ALPHABET, PARSERS, SYMBOLS`

Fields inherited from interface org.biojava.bio.Annotatable
`ANNOTATION`

Method Summary
`protected void` `addSymbolImpl(AtomicSymbol sym)`
`protected boolean` `containsImpl(AtomicSymbol sym)`
`java.util.List` `getAlphabets()` Return an ordered List of the alphabets which make up a compound alphabet.
`Annotation` `getAnnotation()` Should return the associated annotation object.
`java.lang.String` `getName()` Get the name of the alphabet.
`IntegerAlphabet.IntegerSymbol` `getSymbol(int val)`
`protected AtomicSymbol` `getSymbolImpl(java.util.List symL)`
`SymbolTokenization` `getTokenization(java.lang.String name)` Get a SymbolTokenization by name.
`java.util.Iterator` `iterator()` Retrieve an Iterator over the Symbols in this FiniteAlphabet.
`void` `removeSymbol(Symbol sym)` Remove a symbol from this alphabet.
`int` `size()` The number of symbols in the alphabet.

Methods inherited from class org.biojava.bio.symbol.AbstractAlphabet
`addSymbol, contains, getAmbiguity, getAmbiguityImpl, getGapSymbol, getSymbol, putTokenization, readResolve, toString, validate`

Methods inherited from class org.biojava.utils.AbstractChangeable
`addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, 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.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Method Detail

### getName

    public java.lang.String getName()

  Description copied from interface: `Alphabet`
  Get the name of the alphabet.

  Returns:
    the name as a string.

### containsImpl

    protected boolean containsImpl(AtomicSymbol sym)

  Specified by:
    `containsImpl` in class `AbstractAlphabet`

### getTokenization

    public SymbolTokenization getTokenization(java.lang.String name)

  Description copied from interface: `Alphabet`

  Get 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 behaviour of the returned SymbolTokenization is not defined here.

  Specified by:
    `getTokenization` in interface `Alphabet`
  Overrides:
    `getTokenization` in class `AbstractAlphabet`
  Parameters:
    `name` - Currently only "token" is supported.
  Returns:
    an IntegerParser.

### getSymbol

    public IntegerAlphabet.IntegerSymbol getSymbol(int val)
                                            throws IllegalSymbolException

  Throws:
    `IllegalSymbolException`

### size

    public int size()

  Description copied from interface: `FiniteAlphabet`
  The number of symbols in the alphabet.

  Returns:
    the size of the alphabet

### getAlphabets

    public java.util.List getAlphabets()

  Description copied from interface: `Alphabet`
  Return 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.

  Returns:
    a List of alphabets

### getSymbolImpl

    protected AtomicSymbol getSymbolImpl(java.util.List symL)
                                  throws IllegalSymbolException

  Specified by:
    `getSymbolImpl` in class `AbstractAlphabet`
  Throws:
    `IllegalSymbolException`

### addSymbolImpl

    protected void addSymbolImpl(AtomicSymbol sym)
                          throws ChangeVetoException

  Specified by:
    `addSymbolImpl` in class `AbstractAlphabet`
  Throws:
    `ChangeVetoException`

### removeSymbol

    public void removeSymbol(Symbol sym)
                      throws ChangeVetoException

  Description copied from interface: `FiniteAlphabet`
  Remove a symbol from this alphabet.

  If the symbol matches multiple AtomicSymbols, then each matching symbol it will be removed.

  Parameters:
    `sym` - the Symbol to removeintGot
  Throws:
    `ChangeVetoException` - if either the alphabet doesn't allow symbols to be added, or the change was vetoed

### iterator

    public java.util.Iterator iterator()

  Description copied from interface: `FiniteAlphabet`
  Retrieve an Iterator over the Symbols 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.

  Returns:
    an Iterator over the contained AtomicSymbol objects

### getAnnotation

    public Annotation getAnnotation()

  Description copied from interface: `Annotatable`
  Should return the associated annotation object.

  Returns:
    an Annotation object, never null