Class SequentialJELRowReader

All Implemented Interfaces:
Closeable, AutoCloseable, uk.ac.starlink.table.RowData, uk.ac.starlink.table.RowSequence, uk.ac.starlink.util.Sequence

public class SequentialJELRowReader extends StarTableJELRowReader implements uk.ac.starlink.table.RowSequence
Implements JELRowReader for sequential access to a table. This class also implements RowSequence, and this object should be treated in the same way as a row sequence taken out on its table, that is iteration should proceed using the next and close methods.
Since:
8 Feb 2005
Author:
Mark Taylor (Starlink)
  • Constructor Details

    • SequentialJELRowReader

      public SequentialJELRowReader(uk.ac.starlink.table.StarTable table) throws IOException
      Constructs a new row reader for sequential access. This constructor also takes out a row sequence on table.
      Parameters:
      table - table to read
      Throws:
      IOException
    • SequentialJELRowReader

      public SequentialJELRowReader(uk.ac.starlink.table.StarTable table, uk.ac.starlink.table.RowSplittable rsplit)
      Constructs a new row reader for sequential access, based on a supplied row splittable.

      Note if the RowSplittable.rowIndex() method of the supplied RowSplittable returns null, the getCurrentRow() method of the object constructed here will throw an exception. Before using this reader to evaluate an expression, the StarTableJELRowReader.requiresRowIndex() method should be called to determine if trouble lies ahead.

      Parameters:
      table - table to read
      rsplit - row splittable, must apply to the supplied table
  • Method Details

    • getCell

      public Object getCell(int icol) throws IOException
      Description copied from class: StarTableJELRowReader
      Returns the value for a given column in this reader's table at the current row.
      Specified by:
      getCell in interface uk.ac.starlink.table.RowData
      Specified by:
      getCell in interface uk.ac.starlink.table.RowSequence
      Specified by:
      getCell in class StarTableJELRowReader
      Parameters:
      icol - column index
      Returns:
      contents of column icol at the current row
      Throws:
      IOException
    • getRow

      public Object[] getRow() throws IOException
      Specified by:
      getRow in interface uk.ac.starlink.table.RowData
      Specified by:
      getRow in interface uk.ac.starlink.table.RowSequence
      Throws:
      IOException
    • next

      public boolean next() throws IOException
      Specified by:
      next in interface uk.ac.starlink.table.RowSequence
      Specified by:
      next in interface uk.ac.starlink.util.Sequence
      Throws:
      IOException
    • getCurrentRow

      public long getCurrentRow()
      If the current row is not known, an RuntimeException will be thrown.
      Specified by:
      getCurrentRow in class StarTableJELRowReader
      Returns:
      row index (first row is 0)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface uk.ac.starlink.table.RowSequence
      Throws:
      IOException