public abstract class BintableStarTable
extends uk.ac.starlink.table.AbstractStarTable
implements java.io.Closeable
The implementation varies according to whether random or sequential-only access is provided by the underlying data access. A factory method is provided to create an appropriate instance.
Some instances of this class hang on to file descriptors.
If you are in danger of running out of that resource before
insstances are garbage collected, you can call the Closeable.close()
method to release them. Attempting to read data following
such a call may result in an exception.
Modifier and Type | Field and Description |
---|---|
static uk.ac.starlink.table.ValueInfo |
TBCOL_INFO
Column aux metadata key for TBCOLn cards.
|
static uk.ac.starlink.table.ValueInfo |
TDISP_INFO
Column aux metadata key for TDISPn cards.
|
static uk.ac.starlink.table.ValueInfo |
TFORM_INFO
Column aux metadata key for TFORMn cards.
|
static uk.ac.starlink.table.ValueInfo |
TNULL_INFO
Column aux metadata key for TNULLn cards.
|
static uk.ac.starlink.table.ValueInfo |
TSCAL_INFO
Column aux metadata key for TSCALn cards.
|
static uk.ac.starlink.table.ValueInfo |
TZERO_INFO
Column aux metadata key for TZEROn cards.
|
Modifier | Constructor and Description |
---|---|
protected |
BintableStarTable(nom.tam.fits.Header hdr,
boolean isRandom)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static BintableStarTable |
createTable(nom.tam.fits.Header hdr,
InputFactory inputFact)
Returns an instance of this class given a data access instance.
|
java.util.List |
getColumnAuxDataInfos() |
int |
getColumnCount() |
uk.ac.starlink.table.ColumnInfo |
getColumnInfo(int icol) |
protected int[] |
getColumnOffsets()
Returns the array of byte offsets from the start of the row at
which each column starts.
|
long |
getRowCount() |
protected int |
getRowLength()
Returns the number of bytes occupied in the data stream by a single
row of the table.
|
protected java.lang.Object |
readCell(BasicInput stream,
int icol)
Reads a cell from a given column from the current position in
a stream.
|
protected java.lang.Object[] |
readRow(BasicInput stream)
Reads a whole row of the table from the current position in a stream,
returning a new Object[] array.
|
static void |
streamStarTable(nom.tam.fits.Header hdr,
BasicInput input,
uk.ac.starlink.table.TableSink sink)
Reads a BINTABLE extension from a stream and writes the result to
a table sink.
|
checkedLongToInt, getCell, getName, getParameterByName, getParameters, getRow, getRowSequence, getURL, isRandom, setName, setParameter, setParameters, setURL
public static final uk.ac.starlink.table.ValueInfo TNULL_INFO
public static final uk.ac.starlink.table.ValueInfo TSCAL_INFO
public static final uk.ac.starlink.table.ValueInfo TZERO_INFO
public static final uk.ac.starlink.table.ValueInfo TDISP_INFO
public static final uk.ac.starlink.table.ValueInfo TBCOL_INFO
public static final uk.ac.starlink.table.ValueInfo TFORM_INFO
protected BintableStarTable(nom.tam.fits.Header hdr, boolean isRandom) throws nom.tam.fits.FitsException
hdr
- FITS header cardsisRandom
- true if the data access will be random-access,
false for sequential-onlynom.tam.fits.FitsException
public long getRowCount()
getRowCount
in interface uk.ac.starlink.table.StarTable
getRowCount
in class uk.ac.starlink.table.AbstractStarTable
public int getColumnCount()
getColumnCount
in interface uk.ac.starlink.table.StarTable
getColumnCount
in class uk.ac.starlink.table.AbstractStarTable
public uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol)
getColumnInfo
in interface uk.ac.starlink.table.StarTable
getColumnInfo
in class uk.ac.starlink.table.AbstractStarTable
public java.util.List getColumnAuxDataInfos()
getColumnAuxDataInfos
in interface uk.ac.starlink.table.StarTable
getColumnAuxDataInfos
in class uk.ac.starlink.table.AbstractStarTable
protected java.lang.Object readCell(BasicInput stream, int icol) throws java.io.IOException
icol
- the column index corresponding to the cell to be readstream
- a stream containing the byte data, positioned to
the right placejava.io.IOException
protected java.lang.Object[] readRow(BasicInput stream) throws java.io.IOException
stream
- a stream containing the byte data, positioned to
the right placejava.io.IOException
protected int getRowLength()
protected int[] getColumnOffsets()
public static BintableStarTable createTable(nom.tam.fits.Header hdr, InputFactory inputFact) throws java.io.IOException, nom.tam.fits.FitsException
hdr
- FITS header cardsinputFact
- factory for access to the data part of the
HDU representing a FITS BINTABLE extensionjava.io.IOException
nom.tam.fits.FitsException
public static void streamStarTable(nom.tam.fits.Header hdr, BasicInput input, uk.ac.starlink.table.TableSink sink) throws nom.tam.fits.FitsException, java.io.IOException
hdr
- FITS header object describing the BINTABLE extensioninput
- input stream positioned at the start of the
data part of the BINTABLE extensionsink
- destination for the tablenom.tam.fits.FitsException
java.io.IOException
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.