Interface SavotDataReader

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    DataBinaryReader

    public interface SavotDataReader
    extends java.io.Closeable
    Common interface of a reader of a VOTable DATA node (whatever is its child node: FITS, BINARY or TABLEDATA).
    Since:
    09/2011
    Author:
    Gregory Mantelet
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object getCell​(int indColumn)
      Gets the specified cell of the last read row.
      java.lang.String getCellAsString​(int indColumn)
      Gets the specified cell of the last read row as a String.
      java.lang.Object[] getRow()
      Gets the last read row.
      SavotTD getTD​(int indColumn)
      Gets the specified cell of the last read row as SavotTD.
      SavotTR getTR()
      Gets the last read row as a SavotTR object.
      boolean next()
      Reads to the next row.
      • Methods inherited from interface java.io.Closeable

        close
    • Method Detail

      • next

        boolean next()
              throws java.io.IOException

        Reads to the next row.

        Once this function called, you can get the full row with getRow() or getTR(), or get specific cells with getCell(int), getCellAsString(int) or getTD(int).

        Returns:
        true if the next row has been successfully fetched, false otherwise.
        Throws:
        java.io.IOException - If an error occurs while reading the next row.
      • getRow

        java.lang.Object[] getRow()
                           throws java.lang.IllegalStateException
        Gets the last read row.
        Returns:
        The last read row.
        Throws:
        java.lang.IllegalStateException - If next has not yet been called, if the EOF has been reached, or if the reader is closed.
      • getTR

        SavotTR getTR()
               throws java.lang.IllegalStateException
        Gets the last read row as a SavotTR object.
        Returns:
        The last read row.
        Throws:
        java.lang.IllegalStateException - If next has not yet been called, if the EOF has been reached, or if the reader is closed.
      • getCell

        java.lang.Object getCell​(int indColumn)
                          throws java.lang.ArrayIndexOutOfBoundsException,
                                 java.lang.IllegalStateException
        Gets the specified cell of the last read row.
        Parameters:
        indColumn - Index of the cell to get.
        Returns:
        The specified cell of the last read row.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the given index is less than 0 or is greater than the number of available cell.
        java.lang.IllegalStateException - If next has not yet been called, if the EOF has been reached, or if the reader is closed.
      • getCellAsString

        java.lang.String getCellAsString​(int indColumn)
                                  throws java.lang.ArrayIndexOutOfBoundsException,
                                         java.lang.IllegalStateException
        Gets the specified cell of the last read row as a String.
        Parameters:
        indColumn - Index of the cell to get.
        Returns:
        The string representation of specified cell.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the given index is less than 0 or is greater than the number of available cell.
        java.lang.IllegalStateException - If next has not yet been called, if the EOF has been reached, or if the reader is closed.
      • getTD

        SavotTD getTD​(int indColumn)
               throws java.lang.ArrayIndexOutOfBoundsException,
                      java.lang.IllegalStateException
        Gets the specified cell of the last read row as SavotTD.
        Parameters:
        indColumn - Index of the cell to get.
        Returns:
        The specified cell of the last read row.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If the given index is less than 0 or is greater than the number of available cell.
        java.lang.IllegalStateException - If next has not yet been called, if the EOF has been reached, or if the reader is closed.