uk.ac.starlink.votable
Class VOStarTable

java.lang.Object
  |
  +--uk.ac.starlink.table.AbstractStarTable
        |
        +--uk.ac.starlink.votable.VOStarTable
All Implemented Interfaces:
StarTable

public class VOStarTable
extends AbstractStarTable

A StarTable implementation based on a VOTable.


Constructor Summary
VOStarTable(TableElement votable)
          Construct a VOStarTable from a VOTable Table object.
 
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 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, setParameters, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VOStarTable

public VOStarTable(TableElement votable)
            throws IOException
Construct a VOStarTable from a VOTable Table object.

Parameters:
votable - Table VOElement
Method Detail

getColumnCount

public int getColumnCount()
Description copied from interface: StarTable
Returns the number of columns in this table.

Specified by:
getColumnCount in interface StarTable
Specified by:
getColumnCount in class AbstractStarTable
Returns:
the number of columns

getRowCount

public long getRowCount()
Description copied from interface: StarTable
Returns the number of rows in this table, if known. If the number of rows cannot be (easily) determined, a value of -1 will be returned.

Specified by:
getRowCount in interface StarTable
Specified by:
getRowCount in class AbstractStarTable
Returns:
the number of rows, or -1

isRandom

public boolean isRandom()
Description copied from class: AbstractStarTable
The AbstractStarTable implementation of this method returns false.

Specified by:
isRandom in interface StarTable
Overrides:
isRandom in class AbstractStarTable
Returns:
true if table random access methods are available

getColumnInfo

public ColumnInfo getColumnInfo(int icol)
Description copied from interface: StarTable
Returns the object describing the data in a given column.

Specified by:
getColumnInfo in interface StarTable
Specified by:
getColumnInfo in class AbstractStarTable
Parameters:
icol - the column for which header information is required
Returns:
a ValueInfo object for column icol

getParameters

public List getParameters()
Description copied from interface: StarTable
Returns a list of table parameters, that is items which pertain to the entire table. Each element of this list must be a DescribedValue object.

Specified by:
getParameters in interface StarTable
Overrides:
getParameters in class AbstractStarTable
Returns:
a List of DescribedValue objects constituting table-wide metadata not covered elsewhere in this interface

getColumnAuxDataInfos

public List getColumnAuxDataInfos()
Description copied from class: AbstractStarTable
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. Subclasses should override this if they can do better, for instance providing an order for the keys.

Specified by:
getColumnAuxDataInfos in interface StarTable
Overrides:
getColumnAuxDataInfos in class AbstractStarTable
Returns:
a list of all the auxiliary metadata ValueInfo items which in fact crop up in column metadata

getRowSequence

public RowSequence getRowSequence()
                           throws IOException
Description copied from interface: StarTable
Returns an object which can iterate over all the rows in the table sequentially.

Specified by:
getRowSequence in interface StarTable
Specified by:
getRowSequence in class AbstractStarTable
Returns:
an object providing sequential access to the table data
Throws:
IOException - if there is an error providing access

getRow

public Object[] getRow(long lrow)
                throws IOException
Description copied from class: AbstractStarTable
The AbstractStarTable implementation of this method constructs a row by repeated invocation of AbstractStarTable.getCell(long, int).

Specified by:
getRow in interface StarTable
Overrides:
getRow in class AbstractStarTable
Parameters:
lrow - the index of the row to retrieve
Returns:
an array of the objects in each cell in row irow
Throws:
IOException - if there is an error reading the data

getCell

public Object getCell(long lrow,
                      int icol)
               throws IOException
Description copied from class: AbstractStarTable
The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access.

Specified by:
getCell in interface StarTable
Overrides:
getCell in class AbstractStarTable
Parameters:
lrow - the index of the cell's row
icol - the index of the cell's column
Returns:
the contents of this cell
Throws:
IOException - if there is an error reading the data

getValueInfo

public static ValueInfo getValueInfo(FieldElement field)
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

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.