|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.votable.VOStarTable
public class VOStarTable
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.
| Field Summary | |
|---|---|
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 |
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. |
static ValueInfo |
XTYPE_INFO
ValueInfo for VOTable xtype attribute. |
| Constructor Summary | |
|---|---|
VOStarTable(TableElement votable)
Construct a VOStarTable from a TABLE element. |
|
| Method Summary | |
|---|---|
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 |
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. |
List |
getParameters()
Returns a list of table parameters, that is items which pertain to the entire table. |
Object[] |
getRow(long lrow)
The AbstractStarTable implementation of this method constructs a row by repeated invocation of AbstractStarTable.getCell(long, int). |
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. |
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. |
| Methods inherited from class uk.ac.starlink.table.AbstractStarTable |
|---|
checkedLongToInt, getName, getParameterByName, getURL, setName, setParameter, setParameters, setURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ValueInfo ID_INFO
public static final ValueInfo UCD_INFO
public static final ValueInfo UTYPE_INFO
public static final ValueInfo XTYPE_INFO
public static final ValueInfo WIDTH_INFO
public static final ValueInfo PRECISION_INFO
public static final ValueInfo REF_INFO
public static final ValueInfo TYPE_INFO
public static final ValueInfo DATATYPE_INFO
| Constructor Detail |
|---|
public VOStarTable(TableElement votable)
throws IOException
votable - Table VOElement
IOException| Method Detail |
|---|
public int getColumnCount()
StarTable
getColumnCount in interface StarTablegetColumnCount in class AbstractStarTablepublic long getRowCount()
StarTable
getRowCount in interface StarTablegetRowCount in class AbstractStarTablepublic boolean isRandom()
AbstractStarTable
isRandom in interface StarTableisRandom in class AbstractStarTablepublic ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo in interface StarTablegetColumnInfo in class AbstractStarTableicol - the column for which header information is required
public List getParameters()
StarTableDescribedValue object.
getParameters in interface StarTablegetParameters in class AbstractStarTablepublic List getColumnAuxDataInfos()
AbstractStarTable
getColumnAuxDataInfos in interface StarTablegetColumnAuxDataInfos in class AbstractStarTableColumnInfo.getAuxData()
public RowSequence getRowSequence()
throws IOException
StarTable
getRowSequence in interface StarTablegetRowSequence in class AbstractStarTableIOException - if there is an error providing access
public Object[] getRow(long lrow)
throws IOException
AbstractStarTableAbstractStarTable.getCell(long, int).
getRow in interface StarTablegetRow in class AbstractStarTablelrow - the index of the row to retrieve
IOException - if there is an error reading the data
public Object getCell(long lrow,
int icol)
throws IOException
AbstractStarTable
getCell in interface StarTablegetCell in class AbstractStarTablelrow - the index of the cell's rowicol - the index of the cell's column
IOException - if there is an error reading the datapublic static ValueInfo getValueInfo(FieldElement field)
field - the FieldElement object for which the ValueInfo is to be
constructed
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||