public class VOStarTable extends AbstractStarTable
StarTable
implementation based on a VOTable.
Some of the FIELD attributes defined by the VOTable format correspond to standard information in the corresponding ColumnInfo object, and some do not. Those that do are accessed using the relevant ColumnInfo getter/setter methods directly, for instance
String ucd = table.getColumnInfo(0).getUCD();The ones that don't are stored in the ColumnInfo's auxiliary metadata keyed using the various
*_INFO
public static variables defined
in this class. These are accessed using the
ColumnInfo.getAuxDatum(uk.ac.starlink.table.ValueInfo)
method, for instance:
String id = (String) table.getColumnInfo(0) .getAuxDatumValue(VOStarTable.ID_INFO);In the same way, if you set an auxiliary metadata item under one of these keys, like this:
DescribedValue idVal = new DescribedValue(VOStarTable.ID_INFO, "COL0"); table.getColumnInfo(0).setAuxDatum(idVal);then if the result is written to a VOTable the relevant attribute will be attached to the corresponding FIELD element.
Modifier and Type | Field and Description |
---|---|
static ValueInfo |
COOSYS_EPOCH_INFO
ValueInfo for COOSYS
epoch attribute. |
static ValueInfo |
COOSYS_EQUINOX_INFO
ValueInfo for COOSYS
equinox attribute. |
static ValueInfo |
COOSYS_REFPOSITION_INFO
ValueInfo for COOSYS
refposition attribute. |
static ValueInfo |
COOSYS_SYSTEM_INFO
ValueInfo for COOSYS
system attribute. |
static ValueInfo |
DATATYPE_INFO
ValueInfo for VOTable
datatype attribute. |
static ValueInfo |
ID_INFO
ValueInfo for VOTable
ID attribute. |
static ValueInfo |
PRECISION_INFO
ValueInfo for VOTable
precision attribute. |
static ValueInfo |
REF_INFO
ValueInfo for VOTable
ref attribute. |
static ValueInfo |
TIMESYS_REFPOSITION_INFO
ValueInfo for TIMESYS
refposition attribute. |
static ValueInfo |
TIMESYS_TIMEORIGIN_INFO
ValueInfo for TIMESYS
timeorigin attribute. |
static ValueInfo |
TIMESYS_TIMESCALE_INFO
ValueInfo for TIMESYS
timescale attribute. |
static ValueInfo |
TYPE_INFO
ValueInfo for VOTable
type attribute. |
static ValueInfo |
UCD_INFO
ValueInfo for VOTable
ucd attribute. |
static ValueInfo |
UTYPE_INFO
ValueInfo for VOTable
utype attribute. |
static ValueInfo |
WIDTH_INFO
ValueInfo for VOTable
width attribute. |
Constructor and Description |
---|
VOStarTable(TableElement tableEl)
Construct a VOStarTable from a TABLE element.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
The
AbstractStarTable implementation of this method
does nothing. |
Object |
getCell(long lrow,
int icol)
The
AbstractStarTable implementation of this method
throws an UnsupportedOperationException ,
since unless otherwise provided there is no random access. |
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.
|
static int |
getRefColumnIndex(String colRef,
StarTable table)
Identifies the column that was labelled with a given ID attribute.
|
Object[] |
getRow(long lrow)
The
AbstractStarTable implementation of this method
constructs a row by repeated invocation of AbstractStarTable.getCell(long, int) . |
RowAccess |
getRowAccess()
Returns an object which can provide random access to this
table's data, if random access is implemented.
|
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.
|
TableElement |
getTableElement()
Returns the TABLE element on which this VOStarTable is built.
|
static ValueInfo |
getValueInfo(FieldElement field)
Returns a ValueInfo object suitable for holding the values in a
VOTable Field (or Param) object.
|
boolean |
isRandom()
The
AbstractStarTable implementation of this method
returns false . |
checkedLongToInt, getName, getParameters, getRowSplittable, getURL, setName, setParameters, setURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterByName, setParameter
public static final ValueInfo ID_INFO
ID
attribute.public static final ValueInfo UCD_INFO
ucd
attribute.public static final ValueInfo UTYPE_INFO
utype
attribute.public static final ValueInfo WIDTH_INFO
width
attribute.public static final ValueInfo PRECISION_INFO
precision
attribute.public static final ValueInfo REF_INFO
ref
attribute.public static final ValueInfo TYPE_INFO
type
attribute.public static final ValueInfo DATATYPE_INFO
datatype
attribute.public static final ValueInfo COOSYS_SYSTEM_INFO
system
attribute.public static final ValueInfo COOSYS_EPOCH_INFO
epoch
attribute.public static final ValueInfo COOSYS_REFPOSITION_INFO
refposition
attribute.public static final ValueInfo COOSYS_EQUINOX_INFO
equinox
attribute.public static final ValueInfo TIMESYS_TIMEORIGIN_INFO
timeorigin
attribute.public static final ValueInfo TIMESYS_TIMESCALE_INFO
timescale
attribute.public static final ValueInfo TIMESYS_REFPOSITION_INFO
refposition
attribute.public VOStarTable(TableElement tableEl) throws IOException
tableEl
- Table VOElementIOException
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 boolean isRandom()
AbstractStarTable
AbstractStarTable
implementation of this method
returns false
.isRandom
in interface StarTable
isRandom
in class AbstractStarTable
true
if table random access methods are availablepublic ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class AbstractStarTable
icol
- the column for which header information is requiredicol
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 IOException
StarTable
getRowSequence
in interface StarTable
getRowSequence
in class AbstractStarTable
IOException
- if there is an error providing accesspublic RowAccess getRowAccess() throws IOException
StarTable
getRowAccess
in interface StarTable
getRowAccess
in class AbstractStarTable
IOException
- if there is an error setting up accesspublic Object[] getRow(long lrow) throws IOException
AbstractStarTable
AbstractStarTable
implementation of this method
constructs a row by repeated invocation of AbstractStarTable.getCell(long, int)
.getRow
in interface StarTable
getRow
in class AbstractStarTable
lrow
- the index of the row to retrieveirow
IOException
- if there is an error reading the datapublic Object getCell(long lrow, int icol) throws IOException
AbstractStarTable
AbstractStarTable
implementation of this method
throws an UnsupportedOperationException
,
since unless otherwise provided there is no random access.getCell
in interface StarTable
getCell
in class AbstractStarTable
lrow
- the index of the cell's rowicol
- the index of the cell's columnIOException
- if there is an error reading the datapublic 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
public TableElement getTableElement()
public static ValueInfo getValueInfo(FieldElement field)
field
- the FieldElement object for which the ValueInfo is to be
constructedfield
public static int getRefColumnIndex(String colRef, StarTable table)
colRef
- ID stringtable
- table to interrogate; this will presumably be based
on a VOStarTable, but it may be some kind of
wrapped form of onetable
whose FIELD
element had an ID attribute of colRef
,
or -1 if none existsCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.