Package org.biojava.bio.seq.io
Class SeqIOFilter
java.lang.Object
org.biojava.bio.seq.io.SeqIOFilter
- All Implemented Interfaces:
SeqIOListener
Base-class for listeners that pass filtered events onto another listener.
- Since:
- 1.1
- Author:
- Matthew Pocock
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSeqIOFilter(SeqIOListener delegate) Create a new SeqIOFilter that will forward events on to another listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeatureProperty(Object key, Object value) Notify the listener of a feature property.voidaddSequenceProperty(Object key, Object value) Notify the listener of a sequence-wide property.voidaddSymbols(Alphabet alpha, Symbol[] syms, int start, int length) Notify the listener of symbol data.voidMark the end of data associated with one specific feature.voidNotify the listener that processing of the sequence is complete.Retrieve the delegate that is wrapped.voidNotify the listener that the current sequence is generally known by a particular name.voidNotify the listener of a URI identifying the current sequence.voidstartFeature(Feature.Template templ) Notify the listener that a new feature object is starting.voidStart the processing of a sequence.
-
Constructor Details
-
SeqIOFilter
Create a new SeqIOFilter that will forward events on to another listener.- Parameters:
delegate- the SeqIOListener to wrap
-
-
Method Details
-
getDelegate
Retrieve the delegate that is wrapped.- Returns:
- the SeqIOListener delegate
-
startSequence
Description copied from interface:SeqIOListenerStart the processing of a sequence. This method exists primarily to enforce the life-cycles of SeqIOListener objects.- Specified by:
startSequencein interfaceSeqIOListener- Throws:
ParseException
-
endSequence
Description copied from interface:SeqIOListenerNotify the listener that processing of the sequence is complete.- Specified by:
endSequencein interfaceSeqIOListener- Throws:
ParseException
-
setName
Description copied from interface:SeqIOListenerNotify the listener that the current sequence is generally known by a particular name.- Specified by:
setNamein interfaceSeqIOListener- Parameters:
name- the String that should be returned by getName for the sequence being parsed- Throws:
ParseException
-
setURI
Description copied from interface:SeqIOListenerNotify the listener of a URI identifying the current sequence.- Specified by:
setURIin interfaceSeqIOListener- Throws:
ParseException
-
addSymbols
public void addSymbols(Alphabet alpha, Symbol[] syms, int start, int length) 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- Parameters:
alpha- The alphabet of the symbol datasyms- An array containing symbolsstart- The start offset of valid data within the arraylength- The number of valid symbols in the array- Throws:
IllegalAlphabetException- if we can't cope with this alphabet.
-
addSequenceProperty
Description copied from interface:SeqIOListenerNotify the listener of a sequence-wide property. This might be stored as an entry in the sequence's annotation bundle.- Specified by:
addSequencePropertyin interfaceSeqIOListener- Throws:
ParseException
-
startFeature
Description copied from interface:SeqIOListenerNotify the listener that a new feature object is starting. Every call to startFeature should have a corresponding call to endFeature. If the listener is concerned with a hierarchy of features, it should maintain a stack of `open' features.- Specified by:
startFeaturein interfaceSeqIOListener- Throws:
ParseException
-
endFeature
Description copied from interface:SeqIOListenerMark the end of data associated with one specific feature.- Specified by:
endFeaturein interfaceSeqIOListener- Throws:
ParseException
-
addFeatureProperty
Description copied from interface:SeqIOListenerNotify the listener of a feature property.- Specified by:
addFeaturePropertyin interfaceSeqIOListener- Throws:
ParseException
-