Package cds.savot.binary
Interface SavotDataReader
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DataBinaryReader
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
Modifier and TypeMethodDescriptiongetCell(int indColumn) Gets the specified cell of the last read row.getCellAsString(int indColumn) Gets the specified cell of the last read row as a String.Object[]getRow()Gets the last read row.getTD(int indColumn) Gets the specified cell of the last read row asSavotTD.getTR()Gets the last read row as aSavotTRobject.booleannext()Reads to the next row.
-
Method Details
-
next
Reads to the next row.
Once this function called, you can get the full row with
getRow()orgetTR(), or get specific cells withgetCell(int),getCellAsString(int)orgetTD(int).- Returns:
- true if the next row has been successfully fetched, false otherwise.
- Throws:
IOException- If an error occurs while reading the next row.
-
getRow
Gets the last read row.- Returns:
- The last read row.
- Throws:
IllegalStateException- Ifnexthas not yet been called, if the EOF has been reached, or if the reader is closed.
-
getTR
Gets the last read row as aSavotTRobject.- Returns:
- The last read row.
- Throws:
IllegalStateException- Ifnexthas not yet been called, if the EOF has been reached, or if the reader is closed.
-
getCell
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:
ArrayIndexOutOfBoundsException- If the given index is less than 0 or is greater than the number of available cell.IllegalStateException- Ifnexthas not yet been called, if the EOF has been reached, or if the reader is closed.
-
getCellAsString
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:
ArrayIndexOutOfBoundsException- If the given index is less than 0 or is greater than the number of available cell.IllegalStateException- Ifnexthas not yet been called, if the EOF has been reached, or if the reader is closed.
-
getTD
Gets the specified cell of the last read row asSavotTD.- Parameters:
indColumn- Index of the cell to get.- Returns:
- The specified cell of the last read row.
- Throws:
ArrayIndexOutOfBoundsException- If the given index is less than 0 or is greater than the number of available cell.IllegalStateException- Ifnexthas not yet been called, if the EOF has been reached, or if the reader is closed.
-