org.biojava.bio.program.tagvalue
Class TagDropper

java.lang.Object
  extended byorg.biojava.bio.program.tagvalue.TagValueWrapper
      extended byorg.biojava.bio.program.tagvalue.TagDropper
All Implemented Interfaces:
TagValueListener

public class TagDropper
extends TagValueWrapper

Silently drop all tags except those specified, and pass the rest onto a delegate.

Since:
1.2
Author:
Matthew Pocock

Constructor Summary
TagDropper()
           
TagDropper(TagValueListener tvl)
          Create a new TagDropper that will pass on all retained tags and values to tvl.
 
Method Summary
 void addTag(java.lang.Object tag)
          Add a tag to retain.
 void endTag()
          End the current tag.
 java.util.Set getTags()
           
 void removeTag(java.lang.Object tag)
          Remove a tag so that it will not be retained.
 void startTag(java.lang.Object tag)
          Start a new tag.
 void value(TagValueContext ctxt, java.lang.Object value)
          A value has been seen.
 
Methods inherited from class org.biojava.bio.program.tagvalue.TagValueWrapper
endRecord, getDelegate, setDelegate, startRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagDropper

public TagDropper()

TagDropper

public TagDropper(TagValueListener tvl)
Create a new TagDropper that will pass on all retained tags and values to tvl. Initially, no tags will be retained.

Parameters:
tvl - the TagValueListener to inform of all surviving events
Method Detail

addTag

public void addTag(java.lang.Object tag)
Add a tag to retain.

Parameters:
tag - a tag that will be forwarded to the delegate

removeTag

public void removeTag(java.lang.Object tag)
Remove a tag so that it will not be retained.

Parameters:
tag - a tag that will not be forwarded to the delegate

getTags

public java.util.Set getTags()

startTag

public void startTag(java.lang.Object tag)
              throws ParserException
Description copied from interface: TagValueListener
Start a new tag.

Specified by:
startTag in interface TagValueListener
Overrides:
startTag in class TagValueWrapper
Throws:
ParserException

endTag

public void endTag()
            throws ParserException
Description copied from interface: TagValueListener
End the current tag.

Specified by:
endTag in interface TagValueListener
Overrides:
endTag in class TagValueWrapper
Throws:
ParserException

value

public void value(TagValueContext ctxt,
                  java.lang.Object value)
           throws ParserException
Description copied from interface: TagValueListener
A value has been seen.

Specified by:
value in interface TagValueListener
Overrides:
value in class TagValueWrapper
Throws:
ParserException