uk.ac.starlink.votable

## Class VOStarTable

- java.lang.Object
- - uk.ac.starlink.table.AbstractStarTable
  - - uk.ac.starlink.votable.VOStarTable

- All Implemented Interfaces:
    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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static uk.ac.starlink.table.ValueInfo` | `COOSYS_EPOCH_INFO` ValueInfo for COOSYS `epoch` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `COOSYS_EQUINOX_INFO` ValueInfo for COOSYS `equinox` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `COOSYS_SYSTEM_INFO` ValueInfo for COOSYS `system` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `DATATYPE_INFO` ValueInfo for VOTable `datatype` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `ID_INFO` ValueInfo for VOTable `ID` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `PRECISION_INFO` ValueInfo for VOTable `precision` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `REF_INFO` ValueInfo for VOTable `ref` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `TYPE_INFO` ValueInfo for VOTable `type` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `UCD_INFO` ValueInfo for VOTable `ucd` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `UTYPE_INFO` ValueInfo for VOTable `utype` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `WIDTH_INFO` ValueInfo for VOTable `width` attribute.
    `static uk.ac.starlink.table.ValueInfo` | `XTYPE_INFO` ValueInfo for VOTable `xtype` attribute.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VOStarTable(TableElement votable)` Construct a VOStarTable from a TABLE element.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `getCell(long lrow, int icol)`
    `java.util.List` | `getColumnAuxDataInfos()`
    `int` | `getColumnCount()`
    `uk.ac.starlink.table.ColumnInfo` | `getColumnInfo(int icol)`
    `java.util.List` | `getParameters()`
    `java.lang.Object[]` | `getRow(long lrow)`
    `long` | `getRowCount()`
    `uk.ac.starlink.table.RowSequence` | `getRowSequence()`
    `static uk.ac.starlink.table.ValueInfo` | `getValueInfo(FieldElement field)` Returns a ValueInfo object suitable for holding the values in a VOTable Field (or Param) object.
    `boolean` | `isRandom()`

    - ### 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

    - #### ID_INFO

          public static final uk.ac.starlink.table.ValueInfo ID_INFO

      ValueInfo for VOTable `ID` attribute.

    - #### UCD_INFO

          public static final uk.ac.starlink.table.ValueInfo UCD_INFO

      ValueInfo for VOTable `ucd` attribute.

    - #### UTYPE_INFO

          public static final uk.ac.starlink.table.ValueInfo UTYPE_INFO

      ValueInfo for VOTable `utype` attribute.

    - #### XTYPE_INFO

          public static final uk.ac.starlink.table.ValueInfo XTYPE_INFO

      ValueInfo for VOTable `xtype` attribute.

    - #### WIDTH_INFO

          public static final uk.ac.starlink.table.ValueInfo WIDTH_INFO

      ValueInfo for VOTable `width` attribute.

    - #### PRECISION_INFO

          public static final uk.ac.starlink.table.ValueInfo PRECISION_INFO

      ValueInfo for VOTable `precision` attribute.

    - #### REF_INFO

          public static final uk.ac.starlink.table.ValueInfo REF_INFO

      ValueInfo for VOTable `ref` attribute.

    - #### TYPE_INFO

          public static final uk.ac.starlink.table.ValueInfo TYPE_INFO

      ValueInfo for VOTable `type` attribute.

    - #### DATATYPE_INFO

          public static final uk.ac.starlink.table.ValueInfo DATATYPE_INFO

      ValueInfo for VOTable `datatype` attribute.

    - #### COOSYS_SYSTEM_INFO

          public static final uk.ac.starlink.table.ValueInfo COOSYS_SYSTEM_INFO

      ValueInfo for COOSYS `system` attribute.

    - #### COOSYS_EPOCH_INFO

          public static final uk.ac.starlink.table.ValueInfo COOSYS_EPOCH_INFO

      ValueInfo for COOSYS `epoch` attribute.

    - #### COOSYS_EQUINOX_INFO

          public static final uk.ac.starlink.table.ValueInfo COOSYS_EQUINOX_INFO

      ValueInfo for COOSYS `equinox` attribute.

  - ### Constructor Detail

    - #### VOStarTable

          public VOStarTable(TableElement votable)
                      throws java.io.IOException

      Construct a VOStarTable from a TABLE element. The data itself is inferred or constructed from the state and content of the element.
      Parameters:
        `votable` - Table VOElement
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### getColumnCount

          public int getColumnCount()

      Specified by:
        `getColumnCount` in interface `uk.ac.starlink.table.StarTable`
      Specified by:
        `getColumnCount` in class `uk.ac.starlink.table.AbstractStarTable`

    - #### getRowCount

          public long getRowCount()

      Specified by:
        `getRowCount` in interface `uk.ac.starlink.table.StarTable`
      Specified by:
        `getRowCount` in class `uk.ac.starlink.table.AbstractStarTable`

    - #### isRandom

          public boolean isRandom()

      Specified by:
        `isRandom` in interface `uk.ac.starlink.table.StarTable`
      Overrides:
        `isRandom` in class `uk.ac.starlink.table.AbstractStarTable`

    - #### getColumnInfo

          public uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol)

      Specified by:
        `getColumnInfo` in interface `uk.ac.starlink.table.StarTable`
      Specified by:
        `getColumnInfo` in class `uk.ac.starlink.table.AbstractStarTable`

    - #### getParameters

          public java.util.List getParameters()

      Specified by:
        `getParameters` in interface `uk.ac.starlink.table.StarTable`
      Overrides:
        `getParameters` in class `uk.ac.starlink.table.AbstractStarTable`

    - #### getColumnAuxDataInfos

          public java.util.List getColumnAuxDataInfos()

      Specified by:
        `getColumnAuxDataInfos` in interface `uk.ac.starlink.table.StarTable`
      Overrides:
        `getColumnAuxDataInfos` in class `uk.ac.starlink.table.AbstractStarTable`

    - #### getRowSequence

          public uk.ac.starlink.table.RowSequence getRowSequence()
                                                          throws java.io.IOException

      Specified by:
        `getRowSequence` in interface `uk.ac.starlink.table.StarTable`
      Specified by:
        `getRowSequence` in class `uk.ac.starlink.table.AbstractStarTable`
      Throws:
        `java.io.IOException`

    - #### getRow

          public java.lang.Object[] getRow(long lrow)
                                    throws java.io.IOException

      Specified by:
        `getRow` in interface `uk.ac.starlink.table.StarTable`
      Overrides:
        `getRow` in class `uk.ac.starlink.table.AbstractStarTable`
      Throws:
        `java.io.IOException`

    - #### getCell

          public java.lang.Object getCell(long lrow,
                                          int icol)
                                   throws java.io.IOException

      Specified by:
        `getCell` in interface `uk.ac.starlink.table.StarTable`
      Overrides:
        `getCell` in class `uk.ac.starlink.table.AbstractStarTable`
      Throws:
        `java.io.IOException`

    - #### getValueInfo

          public static uk.ac.starlink.table.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 © 2017 Central Laboratory of the Research Councils. All Rights Reserved.