Class GFFFilterer

  • All Implemented Interfaces:

    public class GFFFilterer
    extends Object
    implements 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.

    Matthew Pocock
    • Constructor Detail

      • GFFFilterer

        public GFFFilterer​(GFFDocumentHandler handler,
                           GFFRecordFilter filter)
        Create a new GFFFilterer that will forward to handler everything that filter accepts.
        handler - the listening GFFDocumentHandler
        filter - the GFFRecordFilter that decides what is forwarded to handler
    • Method Detail

      • startDocument

        public void startDocument​(String locator)
        Description copied from interface: GFFDocumentHandler
        Indicates that a new GFF document has been started. This gives you a hook to set up per-document resources.
        Specified by:
        startDocument in interface GFFDocumentHandler
        locator - A URI for the stream being parsed.
      • commentLine

        public void commentLine​(String comment)
        Description copied from interface: GFFDocumentHandler
        A comment line has been encountered.

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

        Specified by:
        commentLine in interface GFFDocumentHandler
        comment - the comment String