Interface RecordsReader<T>

  • Type Parameters:
    T - The type managed by the Records.
    All Superinterfaces:
    java.lang.AutoCloseable, HeaderAccessor<T>, java.lang.Iterable<T>, java.util.Iterator<T>, Records<T>
    All Known Implementing Classes:
    CsvRecordsReader, CsvStringRecordsReader


    public interface RecordsReader<T>
    extends java.lang.AutoCloseable, Records<T>, HeaderAccessor<T>
    Extends the Records with functionality for file based implementations regarding header management and means to monitor the state of reading data. Reading Record instances may cause problems but no abortion of an operation (if desired), the statistics of the problems may be reported by an implementation of this interface.
    • Method Detail

      • getErroneousRecordCount

        long getErroneousRecordCount​()
        The number of erroneous records which were not read by the RecordsReader.
        Returns:
        the erroneous record count
      • readHeader

        Header<T> readHeader​()
                      throws java.io.IOException
        Creates a Header from the next line to be read .
        Returns:
        Returns the Header being read.
        Throws:
        java.io.IOException - thrown in case reading from IO failed.
      • skipHeader

        java.lang.String skipHeader​()
                             throws java.io.IOException
        Skips the next line to be read. This line will not be processed by the Iterator.next() method. This methods is useful when skipping the first line (header).
        Returns:
        The line being skipped.
        Throws:
        java.io.IOException - thrown in case if IO problems.
      • readNext

        java.lang.String[] readNext​()
        Reads the next line from the (standard) input (stream or file) and returns an array of its String representation.
        Returns:
        The String array representation of the next Record instance read.