Package bref

Class Bref3It

java.lang.Object
bref.Bref3It
All Implemented Interfaces:
FileIt<RefGTRec>, SampleFileIt<RefGTRec>, Closeable, AutoCloseable, Iterator<RefGTRec>

public final class Bref3It extends 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(File brefFile)
    Constructs a new Bref3It instance.
    Bref3It(File brefFile, Filter<String> sampleFilter, Filter<Marker> markerFilter)
    Constructs a new Bref4It instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the input stream and releases any system resources that are associated with it.
    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
    Returns true if the iteration has more elements, and returns false otherwise.
    Returns the next element in the iteration.
    Returns the list of samples.
    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 Details

    • Bref3It

      public Bref3It(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:
      IllegalArgumentException - if a format error is detected in a line of the specified bref file
    • Bref3It

      public Bref3It(File brefFile, Filter<String> sampleFilter, Filter<Marker> markerFilter)
      Constructs a new Bref4It instance.
      Parameters:
      brefFile - a bref v3 file or null if the bref3 file is to be read from stdin
      sampleFilter - a sample filter
      markerFilter - a marker filter
      Throws:
      IllegalArgumentException - if a format error is detected in the specified bref v3 file
      NullPointerException - if (sampleFilter == null) || (markerFilter == null)
  • Method Details

    • hasNext

      public boolean hasNext()
      Returns true if the iteration has more elements, and returns false otherwise.
      Specified by:
      hasNext in interface 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 Iterator<RefGTRec>
      Returns:
      the next element in the iteration
      Throws:
      NoSuchElementException - if the iteration has no more elements
    • close

      public void close()
      Description copied from interface: FileIt
      Closes the input stream and releases any system resources that are associated with it. If the input stream is already closed then invoking this method has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface FileIt<RefGTRec>
    • file

      public 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
    • samples

      public Samples samples()
      Description copied from interface: SampleFileIt
      Returns the list of samples.
      Specified by:
      samples in interface SampleFileIt<RefGTRec>
      Returns:
      the list of samples
    • toString

      public 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 Object
      Returns:
      a string representation of this