org.biojava.bio.program.gff
Interface GFFDocumentHandler

All Known Implementing Classes:
GFFFilterer, GFFWriter

public interface GFFDocumentHandler

The interface for things that listen to GFF event streams.

This allows the GFF push model to run over large collections of GFF, filter them and access other resources without requiering vast numbers of GFF records to be in memory at any one time.

The stream includes both GFF records and comment lines. A particular handeler may choose to discard either of these.

It is assumed that a particular handeler will only be used to listen to a single stream of events in a single thread. Particular implementations may not impose this restriction.

Author:
Matthew Pocock, Thomas Down

Method Summary
 void commentLine(java.lang.String comment)
          A comment line has been encountered.
 void endDocument()
          Indicates that the current GFF document has now ended.
 void recordLine(GFFRecord record)
          A record line has been encountered.
 void startDocument(java.lang.String locator)
          Indicates that a new GFF document has been started.
 

Method Detail

startDocument

public void startDocument(java.lang.String locator)
Indicates that a new GFF document has been started. This gives you a hook to set up per-document resources.
Parameters:
locator - A URI for the stream being parsed.

endDocument

public void endDocument()
Indicates that the current GFF document has now ended.

This gives you the chance to flush results, or do calculations if you wish.


commentLine

public void commentLine(java.lang.String comment)
A comment line has been encountered.

comment has already had the leading '#' removed, and may have had leading-and-trailing whitespace trimmed.

Parameters:
comment - the comment String

recordLine

public void recordLine(GFFRecord record)
A record line has been encountered.

It is already preseneted to you into a GFFRecord object.

Parameters:
record - the GFFRecord containing all the info