org.biojava.bio.symbol
Class WindowedSymbolList

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

public class WindowedSymbolList
extends AbstractSymbolList
implements java.io.Serializable

A view of windows onto another SymbolList.

In practice, what this means is that you can view a DNA sequence as codons which do not overlap.

Author:
Matthew Pocock
See Also:
Serialized Form

Constructor Summary
WindowedSymbolList(SymbolList source, int width)
          Create a WindowedSymbolList with the given window width.
 
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

WindowedSymbolList

public WindowedSymbolList(SymbolList source,
                          int width)
                   throws java.lang.IllegalArgumentException
Create a WindowedSymbolList with the given window width.
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