|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides sequential access to the data in a table. The data is a sequence of rows which may be processed from the first to the last. This object has a current row index which starts off at -1, that is before the first row; the next method must be invoked before the first row can be accessed.
A RowSequence cannot in general be expected to be used safely from multiple threads.
Method Summary | |
void |
advance(long nrows)
Moves the current row forward by offset rows. |
Object |
getCell(int icol)
Returns the contents of a cell in the current row. |
Object[] |
getRow()
Returns the contents of the current table row, as an array with the same number of elements as there are columns in this table. |
long |
getRowIndex()
Returns the index of the current row. |
boolean |
hasNext()
Indicates whether this table contains any more rows after the current one. |
void |
next()
Advances the current row by 1. |
Method Detail |
public void next() throws IOException
getCell(int)
or getRow()
methods are invoked.
IOException
- if there is some error in the positioning
IllegalStateException
- if there are no more rows
(hasNext()
returns false)public boolean hasNext()
public void advance(long nrows) throws IOException
nrows
- the number of rows to advance the current row by.
IllegalArgumentException
- if nrows<0
IOException
- if an attempt to advance beyond the end of the
table is made, or if there is some other read errorpublic Object getCell(int icol) throws IOException
IOException
- if there is an error reading the data
IllegalStateException
- if there is no current row (before the
start of the table)public Object[] getRow() throws IOException
IOException
- if there is an error reading the data
IllegalStateException
- if there is no current row (before the
start of the table)public long getRowIndex()
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |