Class EcsvReader

java.lang.Object
uk.ac.starlink.ecsv.EcsvReader
All Implemented Interfaces:
Closeable, AutoCloseable

public class EcsvReader extends Object implements Closeable
Parser for the metadata and data of an ECSV file. The format currently supported is ECSV 1.0, as documented at Astropy APE6.
Since:
28 Apr 2020
Author:
Mark Taylor
  • Constructor Details

  • Method Details

    • getMeta

      public EcsvMeta getMeta()
      Returns the ECSV metadata object used by this reader.
      Returns:
      parsed metadata
    • next

      public boolean next() throws IOException, EcsvFormatException
      Attempts to advance the current row to the next one. This method must be called before current row data can be accessed using the getCell(int) or getRow() methods.
      Returns:
      true if this sequence has been advanced to the next row, false if there are no more rows
      Throws:
      IOException
      EcsvFormatException
    • getCell

      public Object getCell(int icol)
      Returns the contents of a cell in the current row.
      Returns:
      the contents of cell icol in the current row
    • getRow

      public Object[] getRow()
      Returns the contents of the current row, as an array with one element per column.
      Returns:
      an array of the objects in each cell
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException