Package bref

Class Bref3It

  • All Implemented Interfaces:
    FileIt<RefGTRec>, SampleFileIt<RefGTRec>, java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<RefGTRec>

    public final class Bref3It
    extends java.lang.Object
    implements SampleFileIt<RefGTRec>

    Class Bref3It represents an iterator whose next() which returns records from a bref version 3 file.

    Instances of class Bref3It are not thread-safe.

    Methods of this class will terminate the Java Virtual Machine with an error message if an I/O error or file format error is detected.

    • Constructor Summary

      Constructors 
      Constructor Description
      Bref3It​(java.io.File brefFile)
      Constructs a new Bref3It instance.
      Bref3It​(java.io.File brefFile, Filter<Marker> markerFilter)
      Constructs a new Bref4It instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Stops reading data elements and releases any system resources that are held by this object.
      java.io.File file()
      Returns the file from which the data are read, or null if the data are read from standard input or if the data source is unknown.
      boolean hasNext()
      Returns true if the iteration has more elements, and returns false otherwise.
      RefGTRec next()
      Returns the next element in the iteration.
      Samples samples()
      Returns the list of samples.
      java.lang.String toString()
      Returns a string representation of this.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • Bref3It

        public Bref3It​(java.io.File brefFile)
        Constructs a new Bref3It instance.
        Parameters:
        brefFile - a bref version 3 file or null if the bref version 3 file is to be read from standard input
        Throws:
        java.lang.IllegalArgumentException - if a format error is detected in a line of the specified bref file
      • Bref3It

        public Bref3It​(java.io.File brefFile,
                       Filter<Marker> markerFilter)
        Constructs a new Bref4It instance.
        Parameters:
        brefFile - a bref v4 file
        markerFilter - a marker filter or null
        Throws:
        java.lang.IllegalArgumentException - if a format error is detected in a line of the specified bref v3 file
        java.lang.NullPointerException - if file == null
    • Method Detail

      • hasNext

        public boolean hasNext()
        Returns true if the iteration has more elements, and returns false otherwise.
        Specified by:
        hasNext in interface java.util.Iterator<RefGTRec>
        Returns:
        true if the iteration has more elements
      • next

        public RefGTRec next()
        Returns the next element in the iteration.
        Specified by:
        next in interface java.util.Iterator<RefGTRec>
        Returns:
        the next element in the iteration
        Throws:
        java.util.NoSuchElementException - if the iteration has no more elements
      • close

        public void close()
        Description copied from interface: FileIt
        Stops reading data elements and releases any system resources that are held by this object. Buffered data elements may remain accessible via the hasNext() and next() methods after invoking close(). After invoking close(), further invocations of close() have no effect.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface FileIt<RefGTRec>
      • file

        public java.io.File file()
        Description copied from interface: FileIt
        Returns the file from which the data are read, or null if the data are read from standard input or if the data source is unknown.
        Specified by:
        file in interface FileIt<RefGTRec>
        Returns:
        the file from which the data are read, or null if the data are read from standard input or if the data source is unknown
      • toString

        public java.lang.String toString()
        Description copied from interface: FileIt
        Returns a string representation of this. The exact details of the representation are unspecified and subject to change.
        Specified by:
        toString in interface FileIt<RefGTRec>
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this