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.
        the erroneous record count
      • readHeader

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

        java.lang.String skipHeader​()
        Skips the next line to be read. This line will not be processed by the method. This methods is useful when skipping the first line (header).
        The line being skipped.
        Throws: - 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.
        The String array representation of the next Record instance read.