public abstract class StreamStarTable extends AbstractStarTable
RowEvaluator
Modifier and Type | Field and Description |
---|---|
protected static char |
END
Char representation of -1 (as returned end-of-stream read)
|
Modifier | Constructor and Description |
---|---|
protected |
StreamStarTable()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnCount()
Returns the number of columns in this table.
|
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column.
|
protected java.io.PushbackInputStream |
getInputStream()
Convenience method which returns a buffered pushback stream based
on this table's data source.
|
long |
getRowCount()
Returns the number of rows in this table, if known.
|
RowSequence |
getRowSequence()
Returns an object which can iterate over all the rows in the table
sequentially.
|
protected void |
init(DataSource datsrc)
Initialises the table from the input stream.
|
protected abstract RowEvaluator.Metadata |
obtainMetadata()
Obtains column metadata for this table, probably by reading through
the rows once and using a RowEvaluator.
|
protected abstract java.util.List<java.lang.String> |
readRow(java.io.PushbackInputStream in)
Reads the next row of data from a given stream.
|
checkedLongToInt, close, getCell, getColumnAuxDataInfos, getName, getParameters, getRow, getRowAccess, getRowSplittable, getURL, isRandom, setName, setParameters, setURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterByName, setParameter
protected static final char END
protected StreamStarTable()
init(uk.ac.starlink.util.DataSource)
before doing anything with the constructed table.
It is arranged this way so that the initialisation is able to
call overridden methods in subclasses, which is a Bad thing to
do from a constructor.protected void init(DataSource datsrc) throws TableFormatException, java.io.IOException
obtainMetadata()
, which probably reads
through some or all of the stream.datsrc
- data source from which the stream can be obtainedTableFormatException
java.io.IOException
public int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class AbstractStarTable
public long getRowCount()
StarTable
getRowCount
in interface StarTable
getRowCount
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 RowSequence getRowSequence() throws java.io.IOException
StarTable
getRowSequence
in interface StarTable
getRowSequence
in class AbstractStarTable
java.io.IOException
- if there is an error providing accessprotected java.io.PushbackInputStream getInputStream() throws java.io.IOException
java.io.IOException
protected abstract RowEvaluator.Metadata obtainMetadata() throws TableFormatException, java.io.IOException
TableFormatException
- if the data doesn't represent this
kind of tablejava.io.IOException
- if I/O error is encounteredprotected abstract java.util.List<java.lang.String> readRow(java.io.PushbackInputStream in) throws TableFormatException, java.io.IOException
in
- input streamnull
for end of streamTableFormatException
- if the data doesn't represent this
kind of tablejava.io.IOException
- if I/O error is encountered