|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.starlink.table.RandomRowSequence
An implementation of RowSequence which obtains its data from a random-access StarTable object.
Constructor Summary | |
RandomRowSequence(StarTable startab)
Constructs a RowSequence from a StarTable which must offer random access and know its number of rows. |
Method Summary | |
void |
close()
Indicates that this sequence will not be required any more. |
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. |
boolean |
hasNext()
Indicates whether this table contains any more rows after the current one. |
void |
next()
Advances the current row to the next one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RandomRowSequence(StarTable startab)
startab
- the StarTable object providing the data
IllegalArgumentException
- if startab.isRandom()==false
or startab.getRowCount()<0Method Detail |
public boolean hasNext()
RowSequence
hasNext
in interface RowSequence
public void next()
RowSequence
RowSequence.getCell(int)
or RowSequence.getRow()
methods.
An unchecked exception such as NoSuchElementException
will be thrown if RowSequence.hasNext()
returns false.
next
in interface RowSequence
public Object[] getRow() throws IOException
RowSequence
getRow
in interface RowSequence
IOException
- if there is an error reading the datapublic Object getCell(int icol) throws IOException
RowSequence
getCell
in interface RowSequence
IOException
- if there is an error reading the datapublic void close()
RowSequence
close
is undefined.
close
in interface RowSequence
|
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 |