Interface TableReader

All Known Implementing Classes:
CSVTableReader, TableReaderDB, TableReaderFile, TableReaderStream

public interface TableReader
An interface for forward-only operations on a cursor. Implementations of this class are provided for CSV files, CSV input streams, and DB tables (via JDBC).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    assertColumns​(String[] columns)
    Check to see that the desired columns are present
    void
    Close the cursor and dispose of resources.
    byte[]
    Get the SHA1 digest for this input stream.
    getColumnName​(int index)
    Get the name of a column.
    Get an array of all column labels
    int
    getColumnPos​(String label)
    Get the position of a given column name
    getField​(int index)
    Get the contents of a field, by position.
    getField​(String label)
    Get the contents of a field, by name.
    boolean
    Advance the cursor to the next record.
    int
    Get the number of columns
    Prepare the cursor for use
    void
    setTask​(Task task)
    Set a Task object to report on progress
  • Method Details

    • getColumnName

      String getColumnName(int index)
      Get the name of a column.
    • getColumnNames

      String[] getColumnNames()
      Get an array of all column labels
    • getNumberOfColumns

      int getNumberOfColumns()
      Get the number of columns
    • getColumnPos

      int getColumnPos(String label)
      Get the position of a given column name
    • assertColumns

      boolean assertColumns(String[] columns)
      Check to see that the desired columns are present
    • getField

      String getField(String label)
      Get the contents of a field, by name. Returns null if the field does not exist or an error occurs.
    • getField

      String getField(int index)
      Get the contents of a field, by position. Returns null if the field does not exist or an error occurs.
    • getNext

      boolean getNext() throws TableReaderException
      Advance the cursor to the next record.
      Returns:
      true if the another record is available in the cursor.
      Throws:
      TableReaderException
    • open

      Prepare the cursor for use
      Throws:
      TableReaderException
    • close

      void close()
      Close the cursor and dispose of resources.
    • digest

      byte[] digest()
      Get the SHA1 digest for this input stream.
    • setTask

      void setTask(Task task)
      Set a Task object to report on progress