org.biojava.bio.symbol
Class ReverseSymbolList

java.lang.Object
  |
  +--org.biojava.bio.symbol.AbstractSymbolList
        |
        +--org.biojava.bio.symbol.ReverseSymbolList

public class ReverseSymbolList
extends AbstractSymbolList
implements java.io.Serializable

An reverse view of another SymbolList.

Author:
Matthew Pocock
See Also:
Serialized Form

Constructor Summary
ReverseSymbolList(SymbolList source)
          Create a reverse view of source.
 
Method Summary
 Alphabet getAlphabet()
          The alphabet that this SymbolList is over.
 SymbolList getSource()
          Retrieve the underlying SymbolList being viewed.
 int length()
          The number of symbols in this SymbolList.
 Symbol symbolAt(int index)
          Return the symbol at index, counting from 1.
 
Methods inherited from class org.biojava.bio.symbol.AbstractSymbolList
iterator, seqString, subList, subStr, toList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReverseSymbolList

public ReverseSymbolList(SymbolList source)
Create a reverse view of source.
Method Detail

getSource

public SymbolList getSource()
Retrieve the underlying SymbolList being viewed.
Returns:
the source SymbolList

getAlphabet

public Alphabet getAlphabet()
Description copied from interface: SymbolList
The alphabet that this SymbolList is over.

Every symbol within this SymbolList is a member of this alphabet. alphabet.contains(symbol) == true for each symbol that is within this sequence.

Overrides:
getAlphabet in class AbstractSymbolList
Tags copied from interface: SymbolList
Returns:
the alphabet

length

public int length()
Description copied from interface: SymbolList
The number of symbols in this SymbolList.
Overrides:
length in class AbstractSymbolList
Tags copied from interface: SymbolList
Returns:
the length

symbolAt

public Symbol symbolAt(int index)
                throws java.lang.IndexOutOfBoundsException
Description copied from interface: SymbolList
Return the symbol at index, counting from 1.
Overrides:
symbolAt in class AbstractSymbolList
Tags copied from interface: SymbolList
Parameters:
index - the ofset into this SymbolList
Returns:
the Symbol at that index
Throws:
java.lang.IndexOutOfBoundsException - if index is less than 1, or greater than the length of the symbol list