org.biojava.bio.seq.io
Class SimpleSequenceBuilder
java.lang.Object
org.biojava.bio.seq.io.SequenceBuilderBase
org.biojava.bio.seq.io.SimpleSequenceBuilder
- All Implemented Interfaces:
- SeqIOListener, SequenceBuilder
public class SimpleSequenceBuilder
- extends SequenceBuilderBase
Basic SequenceBuilder implementation which accumulates all
notified information and creates a SimpleSequence.
More functionality is offered by SimpleRichSequenceBuilder
,
Use of this class is prefered.
- Version:
- 1.1 [newio proposal]
- Author:
- Thomas Down, David Huen (modified to derive from SequenceBuilderBase)
- See Also:
SimpleRichSequenceBuilder
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FACTORY
public static final SequenceBuilderFactory FACTORY
SimpleSequenceBuilder
public SimpleSequenceBuilder()
addSymbols
public void addSymbols(Alphabet alpha,
Symbol[] syms,
int pos,
int len)
throws IllegalAlphabetException
- Description copied from interface:
SeqIOListener
- Notify the listener of symbol data. All symbols passed to
this method are guarenteed to be contained within the
specified alphabet. Generally all calls to a given Listener
should have the same alphabet -- if not, the listener implementation
is likely to throw an exception
- Specified by:
addSymbols
in interface SeqIOListener
- Specified by:
addSymbols
in class SequenceBuilderBase
- Parameters:
alpha
- The alphabet of the symbol datasyms
- An array containing symbolspos
- The start offset of valid data within the arraylen
- The number of valid symbols in the array
- Throws:
IllegalAlphabetException
- if we can't cope with this
alphabet.
makeSequence
public Sequence makeSequence()
throws BioException
- Description copied from interface:
SequenceBuilder
- Return the Sequence object which has been constructed
by this builder. This method is only expected to succeed
after the endSequence() notifier has been called.
- Specified by:
makeSequence
in interface SequenceBuilder
- Overrides:
makeSequence
in class SequenceBuilderBase
- Throws:
BioException