Package uk.ac.starlink.votable
Class VOStarTable
java.lang.Object
uk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.votable.VOStarTable
- All Implemented Interfaces:
Closeable,AutoCloseable,uk.ac.starlink.table.StarTable
public class VOStarTable
extends uk.ac.starlink.table.AbstractStarTable
A
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.- Author:
- Mark Taylor (Starlink)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final uk.ac.starlink.table.ValueInfoValueInfo for COOSYSepochattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for COOSYSequinoxattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for COOSYSrefpositionattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for COOSYSsystemattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTabledatatypeattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTableIDattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTableprecisionattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTablerefattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for TIMESYSrefpositionattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for TIMESYStimeoriginattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for TIMESYStimescaleattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTabletypeattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTableucdattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTableutypeattribute.static final uk.ac.starlink.table.ValueInfoValueInfo for VOTablewidthattribute. -
Constructor Summary
ConstructorsConstructorDescriptionVOStarTable(TableElement tableEl) Construct a VOStarTable from a TABLE element. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static VOStarTablecreateDecoratedTable(uk.ac.starlink.table.StarTable dataTable, TableElement metadataEl) Returns a table in which the data comes from an input StarTable, but the metadata is supplied by a TableElement.getCell(long lrow, int icol) List<uk.ac.starlink.table.ValueInfo> intuk.ac.starlink.table.ColumnInfogetColumnInfo(int icol) List<uk.ac.starlink.table.DescribedValue> static intgetRefColumnIndex(String colRef, uk.ac.starlink.table.StarTable table) Identifies the column that was labelled with a given ID attribute.Object[]getRow(long lrow) uk.ac.starlink.table.RowAccesslonguk.ac.starlink.table.RowSequenceReturns the TABLE element on which this VOStarTable is built.static uk.ac.starlink.table.ValueInfogetValueInfo(FieldElement field) Returns a ValueInfo object suitable for holding the values in a VOTable Field (or Param) object.booleanisRandom()Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, getName, getRowSplittable, getURL, setName, setParameters, setURLMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.starlink.table.StarTable
getParameterByName, setParameter
-
Field Details
-
ID_INFO
public static final uk.ac.starlink.table.ValueInfo ID_INFOValueInfo for VOTableIDattribute. -
UCD_INFO
public static final uk.ac.starlink.table.ValueInfo UCD_INFOValueInfo for VOTableucdattribute. -
UTYPE_INFO
public static final uk.ac.starlink.table.ValueInfo UTYPE_INFOValueInfo for VOTableutypeattribute. -
WIDTH_INFO
public static final uk.ac.starlink.table.ValueInfo WIDTH_INFOValueInfo for VOTablewidthattribute. -
PRECISION_INFO
public static final uk.ac.starlink.table.ValueInfo PRECISION_INFOValueInfo for VOTableprecisionattribute. -
REF_INFO
public static final uk.ac.starlink.table.ValueInfo REF_INFOValueInfo for VOTablerefattribute. -
TYPE_INFO
public static final uk.ac.starlink.table.ValueInfo TYPE_INFOValueInfo for VOTabletypeattribute. -
DATATYPE_INFO
public static final uk.ac.starlink.table.ValueInfo DATATYPE_INFOValueInfo for VOTabledatatypeattribute. -
COOSYS_SYSTEM_INFO
public static final uk.ac.starlink.table.ValueInfo COOSYS_SYSTEM_INFOValueInfo for COOSYSsystemattribute. -
COOSYS_EPOCH_INFO
public static final uk.ac.starlink.table.ValueInfo COOSYS_EPOCH_INFOValueInfo for COOSYSepochattribute. -
COOSYS_REFPOSITION_INFO
public static final uk.ac.starlink.table.ValueInfo COOSYS_REFPOSITION_INFOValueInfo for COOSYSrefpositionattribute. -
COOSYS_EQUINOX_INFO
public static final uk.ac.starlink.table.ValueInfo COOSYS_EQUINOX_INFOValueInfo for COOSYSequinoxattribute. -
TIMESYS_TIMEORIGIN_INFO
public static final uk.ac.starlink.table.ValueInfo TIMESYS_TIMEORIGIN_INFOValueInfo for TIMESYStimeoriginattribute. -
TIMESYS_TIMESCALE_INFO
public static final uk.ac.starlink.table.ValueInfo TIMESYS_TIMESCALE_INFOValueInfo for TIMESYStimescaleattribute. -
TIMESYS_REFPOSITION_INFO
public static final uk.ac.starlink.table.ValueInfo TIMESYS_REFPOSITION_INFOValueInfo for TIMESYSrefpositionattribute.
-
-
Constructor Details
-
VOStarTable
Construct a VOStarTable from a TABLE element. The data itself is inferred or constructed from the state and content of the element.- Parameters:
tableEl- Table VOElement- Throws:
IOException
-
-
Method Details
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceuk.ac.starlink.table.StarTable- Specified by:
getColumnCountin classuk.ac.starlink.table.AbstractStarTable
-
getRowCount
public long getRowCount()- Specified by:
getRowCountin interfaceuk.ac.starlink.table.StarTable- Specified by:
getRowCountin classuk.ac.starlink.table.AbstractStarTable
-
isRandom
public boolean isRandom()- Specified by:
isRandomin interfaceuk.ac.starlink.table.StarTable- Overrides:
isRandomin classuk.ac.starlink.table.AbstractStarTable
-
getColumnInfo
public uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol) - Specified by:
getColumnInfoin interfaceuk.ac.starlink.table.StarTable- Specified by:
getColumnInfoin classuk.ac.starlink.table.AbstractStarTable
-
getParameters
- Specified by:
getParametersin interfaceuk.ac.starlink.table.StarTable- Overrides:
getParametersin classuk.ac.starlink.table.AbstractStarTable
-
getColumnAuxDataInfos
- Specified by:
getColumnAuxDataInfosin interfaceuk.ac.starlink.table.StarTable- Overrides:
getColumnAuxDataInfosin classuk.ac.starlink.table.AbstractStarTable
-
getRowSequence
- Specified by:
getRowSequencein interfaceuk.ac.starlink.table.StarTable- Specified by:
getRowSequencein classuk.ac.starlink.table.AbstractStarTable- Throws:
IOException
-
getRowAccess
- Specified by:
getRowAccessin interfaceuk.ac.starlink.table.StarTable- Overrides:
getRowAccessin classuk.ac.starlink.table.AbstractStarTable- Throws:
IOException
-
getRow
- Specified by:
getRowin interfaceuk.ac.starlink.table.StarTable- Overrides:
getRowin classuk.ac.starlink.table.AbstractStarTable- Throws:
IOException
-
getCell
- Specified by:
getCellin interfaceuk.ac.starlink.table.StarTable- Overrides:
getCellin classuk.ac.starlink.table.AbstractStarTable- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceuk.ac.starlink.table.StarTable- Overrides:
closein classuk.ac.starlink.table.AbstractStarTable- Throws:
IOException
-
getTableElement
Returns the TABLE element on which this VOStarTable is built.- Returns:
- TABLE element
-
getValueInfo
Returns a ValueInfo object suitable for holding the values in a VOTable Field (or Param) object. The datatype, array shape and other metadata in the returned object are taken from the relevant bits of the supplied field.- Parameters:
field- the FieldElement object for which the ValueInfo is to be constructed- Returns:
- a ValueInfo suitable for
field
-
getRefColumnIndex
Identifies the column that was labelled with a given ID attribute.- Parameters:
colRef- ID stringtable- table to interrogate; this will presumably be based on a VOStarTable, but it may be some kind of wrapped form of one- Returns:
- index of the column in
tablewhose FIELD element had an ID attribute ofcolRef, or -1 if none exists
-
createDecoratedTable
public static VOStarTable createDecoratedTable(uk.ac.starlink.table.StarTable dataTable, TableElement metadataEl) throws IOException Returns a table in which the data comes from an input StarTable, but the metadata is supplied by a TableElement. It is the responsibility of the calling code to ensure that the supplied metadata is consistent with the supplied data.- Parameters:
dataTable- StarTable supplying datametadataEl- TABLE element supplying metadata- Returns:
- table, not guaranteed to be consistent
- Throws:
IOException
-