Class RowReader

java.lang.Object
com.sparsity.sparksee.io.RowReader
Direct Known Subclasses:
CSVReader

public class RowReader extends Object
RowReader interface.

Common interface for those readers which get the data as an string array.

It works as follows: perform as many read operations as necessary and call close once at the end. Once close is called no more read operations can be executed.

Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.

Author:
Sparsity Technologies http://www.sparsity-technologies.com
  • Method Details

    • close

      public void close() throws IOException
      Closes the reader.

      Throws:
      IOException - If the close fails.
    • reset

      public boolean reset() throws IOException
      Moves the reader to the beginning.

      Restarts the reader.

      Returns:
      true if the reader can be restarted, false otherwise.
      Throws:
      IOException - If bad things happen during the restart.
    • read

      public boolean read(StringList row) throws IOException
      Reads the next row as a string array.

      Parameters:
      row - [out] A string list with each comma-separated element as a separate entry.
      Returns:
      Returns true if a row had been read or false otherwise.
      Throws:
      IOException - If bad things happen during the read.
    • getRow

      public int getRow() throws IOException
      The row number for the current row.

      Returns:
      The current row number; 0 if there is no current row.
      Throws:
      IOException - If it fails.