Package org.biojava.bio.seq.io
Class SmartSequenceBuilder
java.lang.Object
org.biojava.bio.seq.io.SequenceBuilderBase
org.biojava.bio.seq.io.SmartSequenceBuilder
- All Implemented Interfaces:
SeqIOListener,SequenceBuilder
Basic SequenceBuilder implementation which accumulates all
notified information and chooses a sequence implementation
suited to the size of the sequence. This may or may not bit-encode
the symbols (using PackedSymbolList), and may or may not store the
symbols in multiple fixed-length chunks (using ChunkedSymbolList).
More functionality is offered by SimpleRichSequenceBuilder,
Use of this class is prefered.
- Author:
- David Huen, Matthew Pocock
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SequenceBuilderFactorystatic final SequenceBuilderFactoryFields inherited from class org.biojava.bio.seq.io.SequenceBuilderBase
annotation, ERROR_FEATURES_PROPERTY, name, seq, uri -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSymbols(Alphabet alpha, Symbol[] syms, int pos, int len) Notify the listener of symbol data.Return the Sequence object which has been constructed by this builder.Methods inherited from class org.biojava.bio.seq.io.SequenceBuilderBase
addFeatureProperty, addProperty, addSequenceProperty, endFeature, endSequence, setName, setURI, startFeature, startSequence
-
Field Details
-
FACTORY
-
BIT_PACKED
-
-
Method Details
-
addSymbols
public void addSymbols(Alphabet alpha, Symbol[] syms, int pos, int len) throws IllegalAlphabetException Description copied from interface:SeqIOListenerNotify 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:
addSymbolsin interfaceSeqIOListener- Specified by:
addSymbolsin classSequenceBuilderBase- 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
Description copied from interface:SequenceBuilderReturn 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:
makeSequencein interfaceSequenceBuilder- Overrides:
makeSequencein classSequenceBuilderBase- Throws:
BioException
-