Class SimpleSymbolList

  • All Implemented Interfaces:
    Serializable, EventListener, SymbolList, Changeable, ChangeListener

    public class SimpleSymbolList
    extends AbstractSymbolList
    implements ChangeListener, Serializable
    Basic implementation of SymbolList. This is currently backed by a normal Java array.

    SimpleSymbolList is now editable. edit() has been implemented in a way that edits are relatively inefficient, but symbolAt() is very efficient.

    A new constructor SimpleSymbolList(SymbolParser,String) has been added so you can now simply turn a String into a SymbolList. This is mostly to provide a simple way to create a SymbolList for people just trying to get their feet wet. So here is an example.

    String seqString = "gaattc"; FiniteAlphabet dna = (FiniteAlphabet) AlphabetManager.alphabetForName("DNA"); SymbolParser parser = dna.getTokenization("token"); SymbolList mySl = new SimpleSymbolList (parser,seqString); System.out.println("Look at my sequence " + mySl.seqString());

    with the right parser you should be able to make a protein sequence from the String "AspAlaValIleAsp"

    subList() is implemented such that subLists are views of the original until such time as the underlying SymbolList is edited in a way that would modify the subList, at which point the subList gets its own array of Symbols and does not reflect the edit to the original. When subList() is called on another subList (which is a veiw SimpleSymbolList) the new SimpleSymbolList is a view of the original, not the subList.

    Author:
    Thomas Down, David Waring, David Huen (another constructor), George Waldon
    See Also:
    Serialized Form