public class SequentialResultSetStarTable extends AbstractStarTable
ResultSet
.
It can read through the data once, and no more.
Beware: it therefore breaks the general contract of
StarTable
, in that calls of
getRowSequence()
after the first one will throw a
UnrepeatableSequenceException
.
Only use this class if you know that the table needs to be read once only.
Constructor and Description |
---|
SequentialResultSetStarTable(ResultSet rset)
Constructor.
|
SequentialResultSetStarTable(StarResultSet srset)
Constructs from a StarResultSet.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
The
AbstractStarTable implementation of this method
does nothing. |
List<ValueInfo> |
getColumnAuxDataInfos()
Goes through the table columns (
ColumnInfo objects)
and picks out all the AuxData items which exist, generalising
where necessary and returning a union of them in
alphabetical order by name. |
int |
getColumnCount()
Returns the number of columns in this table.
|
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column.
|
ResultSet |
getResultSet()
Returns the result set on which this table is built.
|
long |
getRowCount()
Returns the number of rows in this table, if known.
|
RowSequence |
getRowSequence()
The first time it is called, returns an iterator over the rows of the
result set.
|
checkedLongToInt, getCell, getName, getParameters, getRow, getRowAccess, getRowSplittable, getURL, isRandom, setName, setParameters, setURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterByName, setParameter
public SequentialResultSetStarTable(ResultSet rset) throws SQLException
rset
- result set containing data - should be positioned at startSQLException
public SequentialResultSetStarTable(StarResultSet srset)
srset
- result set containing data - should be positioned at startpublic ResultSet getResultSet()
public int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class AbstractStarTable
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class AbstractStarTable
icol
- the column for which header information is requiredicol
public long getRowCount()
StarTable
getRowCount
in interface StarTable
getRowCount
in class AbstractStarTable
public List<ValueInfo> getColumnAuxDataInfos()
AbstractStarTable
ColumnInfo
objects)
and picks out all the AuxData items which exist, generalising
where necessary and returning a union of them in
alphabetical order by name.
Subclasses should override this if they can do better, for instance
providing an order for the keys.getColumnAuxDataInfos
in interface StarTable
getColumnAuxDataInfos
in class AbstractStarTable
ValueInfo
items which in fact crop up in column metadataDefaultValueInfo.getAuxData()
public RowSequence getRowSequence() throws UnrepeatableSequenceException, IOException
UnrepeatableSequenceException
.getRowSequence
in interface StarTable
getRowSequence
in class AbstractStarTable
UnrepeatableSequenceException
- if called more than onceIOException
- if there is an error providing accesspublic void close() throws IOException
AbstractStarTable
AbstractStarTable
implementation of this method
does nothing.close
in interface Closeable
close
in interface AutoCloseable
close
in interface StarTable
close
in class AbstractStarTable
IOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.