org.biojava.bio.seq.impl
Class AssembledSymbolList

java.lang.Object
  extended by org.biojava.utils.AbstractChangeable
      extended by org.biojava.bio.symbol.AbstractSymbolList
          extended by org.biojava.bio.seq.impl.AssembledSymbolList
All Implemented Interfaces:
SymbolList, Changeable

public class AssembledSymbolList
extends AbstractSymbolList

Support class for applications which need to patch together sections of sequence into a single SymbolList. This class isn't intended for direct use in user code -- instead, it is a helper for people implementing the full BioJava assembly model. See SimpleAssembly for an example.

Since:
1.1
Author:
Thomas Down, Greg Cox, Matthew Pocock

Nested Class Summary
 
Nested classes/interfaces inherited from class org.biojava.bio.symbol.AbstractSymbolList
AbstractSymbolList.EditScreener, AbstractSymbolList.EditTranslater
 
Field Summary
 
Fields inherited from interface org.biojava.bio.symbol.SymbolList
EDIT, EMPTY_LIST
 
Constructor Summary
AssembledSymbolList()
           
 
Method Summary
 Alphabet getAlphabet()
          The alphabet that this SymbolList is over.
 java.util.Set getComponentLocationSet()
           
 int length()
          The number of symbols in this SymbolList.
 void putComponent(ComponentFeature f)
           
 void putComponent(Location l, SymbolList sl)
           
 void removeComponent(Location loc)
           
 void setLength(int len)
           
 SymbolList subList(int start, int end)
          Return a new SymbolList for the symbols start to end inclusive.
 java.lang.String subStr(int start, int end)
          Return a region of this symbol list as a String.
 Symbol symbolAt(int pos)
          Return the symbol at index, counting from 1.
 
Methods inherited from class org.biojava.bio.symbol.AbstractSymbolList
edit, equals, hashCode, iterator, seqString, toList, toString
 
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
 

Constructor Detail

AssembledSymbolList

public AssembledSymbolList()
Method Detail

setLength

public void setLength(int len)

putComponent

public void putComponent(ComponentFeature f)

putComponent

public void putComponent(Location l,
                         SymbolList sl)
Throws:
java.lang.IllegalArgumentException - if sl would introduce a circularity into the tree of components

removeComponent

public void removeComponent(Location loc)

getComponentLocationSet

public java.util.Set getComponentLocationSet()

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.

Returns:
the alphabet

length

public int length()
Description copied from interface: SymbolList
The number of symbols in this SymbolList.

Returns:
the length

symbolAt

public Symbol symbolAt(int pos)
Description copied from interface: SymbolList
Return the symbol at index, counting from 1.

Parameters:
pos - the offset into this SymbolList
Returns:
the Symbol at that index

subList

public SymbolList subList(int start,
                          int end)
Description copied from interface: SymbolList
Return a new SymbolList for the symbols start to end inclusive.

The resulting SymbolList will count from 1 to (end-start + 1) inclusive, and refer to the symbols start to end of the original sequence.

Specified by:
subList in interface SymbolList
Overrides:
subList in class AbstractSymbolList
Parameters:
start - the first symbol of the new SymbolList
end - the last symbol (inclusive) of the new SymbolList

subStr

public java.lang.String subStr(int start,
                               int end)
Description copied from interface: SymbolList
Return a region of this symbol list as a String.

This should use the same rules as seqString.

Specified by:
subStr in interface SymbolList
Overrides:
subStr in class AbstractSymbolList
Parameters:
start - the first symbol to include
end - the last symbol to include
Returns:
the string representation