Package org.biojava.bio.program.gff
Class GFFFilterer
java.lang.Object
org.biojava.bio.program.gff.GFFFilterer
- All Implemented Interfaces:
GFFDocumentHandler
An object that filters a stream of GFF, forwarding some
GFFRecords to a
listening GFFDocumentHandler, and dropping others.
The choice to forward or drop is made by a GFFRecordFilter.
Unless otherwise stated, all methods forward to the listening handler without altering the arguments in any way.
- Author:
- Matthew Pocock
-
Constructor Summary
ConstructorsConstructorDescriptionGFFFilterer(GFFDocumentHandler handler, GFFRecordFilter filter) Create a new GFFFilterer that will forward to handler everything that filter accepts. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommentLine(String comment) A comment line has been encountered.voidIndicates that the current GFF document has now ended.voidrecordLine(GFFRecord record) Only forward the GFFRecords that match a filter.voidstartDocument(String locator) Indicates that a new GFF document has been started.
-
Constructor Details
-
GFFFilterer
Create a new GFFFilterer that will forward to handler everything that filter accepts.- Parameters:
handler- the listening GFFDocumentHandlerfilter- the GFFRecordFilter that decides what is forwarded to handler
-
-
Method Details
-
startDocument
Description copied from interface:GFFDocumentHandlerIndicates that a new GFF document has been started. This gives you a hook to set up per-document resources.- Specified by:
startDocumentin interfaceGFFDocumentHandler- Parameters:
locator- A URI for the stream being parsed.
-
endDocument
Description copied from interface:GFFDocumentHandlerIndicates that the current GFF document has now ended.This gives you the chance to flush results, or do calculations if you wish.
- Specified by:
endDocumentin interfaceGFFDocumentHandler
-
commentLine
Description copied from interface:GFFDocumentHandlerA comment line has been encountered.comment has already had the leading '
#' removed, and may have had leading-and-trailing whitespace trimmed.- Specified by:
commentLinein interfaceGFFDocumentHandler- Parameters:
comment- the comment String
-
recordLine
Only forward the GFFRecords that match a filter.- Specified by:
recordLinein interfaceGFFDocumentHandler- Parameters:
record- the GFFRecord containing all the info
-