Package org.biojava.bio.seq.io
Class SeqIOAdapter
- java.lang.Object
-
- org.biojava.bio.seq.io.SeqIOAdapter
-
- All Implemented Interfaces:
SeqIOListener
public class SeqIOAdapter extends Object implements SeqIOListener
Adapter class for SeqIOListener that has empty methods.- Since:
- 1.1
- Author:
- Matthew Pocock
- See Also:
RichSeqIOAdapter
-
-
Constructor Summary
Constructors Constructor Description SeqIOAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFeatureProperty(Object key, Object value)
Notify the listener of a feature property.void
addSequenceProperty(Object key, Object value)
Notify the listener of a sequence-wide property.void
addSymbols(Alphabet alpha, Symbol[] syms, int start, int length)
Notify the listener of symbol data.void
endFeature()
Mark the end of data associated with one specific feature.void
endSequence()
Notify the listener that processing of the sequence is complete.void
setName(String name)
Notify the listener that the current sequence is generally known by a particular name.void
setURI(String uri)
Notify the listener of a URI identifying the current sequence.void
startFeature(Feature.Template templ)
Notify the listener that a new feature object is starting.void
startSequence()
Start the processing of a sequence.
-
-
-
Constructor Detail
-
SeqIOAdapter
public SeqIOAdapter()
-
-
Method Detail
-
startSequence
public void startSequence() throws ParseException
Description copied from interface:SeqIOListener
Start the processing of a sequence. This method exists primarily to enforce the life-cycles of SeqIOListener objects.- Specified by:
startSequence
in interfaceSeqIOListener
- Throws:
ParseException
-
endSequence
public void endSequence() throws ParseException
Description copied from interface:SeqIOListener
Notify the listener that processing of the sequence is complete.- Specified by:
endSequence
in interfaceSeqIOListener
- Throws:
ParseException
-
setName
public void setName(String name) throws ParseException
Description copied from interface:SeqIOListener
Notify the listener that the current sequence is generally known by a particular name.- Specified by:
setName
in interfaceSeqIOListener
- Parameters:
name
- the String that should be returned by getName for the sequence being parsed- Throws:
ParseException
-
setURI
public void setURI(String uri) throws ParseException
Description copied from interface:SeqIOListener
Notify the listener of a URI identifying the current sequence.- Specified by:
setURI
in interfaceSeqIOListener
- Throws:
ParseException
-
addSymbols
public void addSymbols(Alphabet alpha, Symbol[] syms, int start, int length) 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 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
public void addSequenceProperty(Object key, Object value) throws ParseException
Description copied from interface:SeqIOListener
Notify the listener of a sequence-wide property. This might be stored as an entry in the sequence's annotation bundle.- Specified by:
addSequenceProperty
in interfaceSeqIOListener
- Throws:
ParseException
-
startFeature
public void startFeature(Feature.Template templ) throws ParseException
Description copied from interface:SeqIOListener
Notify 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:
startFeature
in interfaceSeqIOListener
- Throws:
ParseException
-
endFeature
public void endFeature() throws ParseException
Description copied from interface:SeqIOListener
Mark the end of data associated with one specific feature.- Specified by:
endFeature
in interfaceSeqIOListener
- Throws:
ParseException
-
addFeatureProperty
public void addFeatureProperty(Object key, Object value) throws ParseException
Description copied from interface:SeqIOListener
Notify the listener of a feature property.- Specified by:
addFeatureProperty
in interfaceSeqIOListener
- Throws:
ParseException
-
-