uk.ac.starlink.gbin

## Class GbinStarTable

- java.lang.Object
- - uk.ac.starlink.table.AbstractStarTable
  - - uk.ac.starlink.gbin.GbinStarTable

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, StarTable

      public abstract class GbinStarTable
      extends AbstractStarTable

  Partial StarTable implementation for use with GBIN files.
  Since:
    6 Jun 2017

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `GbinStarTable(GbinTableProfile profile, java.lang.Class<?> gobjClazz)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> GbinStarTable` | `createCollectionTable(GbinTableProfile profile, java.lang.Class<T> gobjClazz, java.util.Collection<? extends T> gobjList)` Returns a table instance based on a collection of gaia objects.
    `RowSequence` | `createRowSequence(GbinObjectReader reader, java.lang.Object gobj0)` Returns a row sequence for this table based on some required objects.
    `int` | `getColumnCount()` Returns the number of columns in this table.
    `ColumnInfo` | `getColumnInfo(int icol)` Returns the object describing the data in a given column.
    `java.lang.Class<?>` | `getGaiaObjectClass()` Returns the class of the elements contained in the GBIN file.

    - ### Methods inherited from class uk.ac.starlink.table.AbstractStarTable

      `checkedLongToInt, close, getCell, getColumnAuxDataInfos, getName, getParameters, getRow, getRowAccess, getRowCount, getRowSequence, getRowSplittable, getURL, isRandom, setName, setParameters, setURL`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface uk.ac.starlink.table.StarTable

      `getParameterByName, setParameter`

- - ### Constructor Detail

    - #### GbinStarTable

          protected GbinStarTable(GbinTableProfile profile,
                                  java.lang.Class<?> gobjClazz)

      Constructor.
      Parameters:
        `profile` - configures how GBIN files will be mapped to a table
        `gobjClazz` - class of all objects in GBIN file

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

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

    - #### createRowSequence

          public RowSequence createRowSequence(GbinObjectReader reader,
                                               java.lang.Object gobj0)

      Returns a row sequence for this table based on some required objects.
      Parameters:
        `reader` - gbin object reader positioned after the first object in the stream; must read objects suitable for this table
        `gobj0` - first object read from reader
      Returns:
        new row sequence for this table

    - #### getGaiaObjectClass

          public java.lang.Class<?> getGaiaObjectClass()

      Returns the class of the elements contained in the GBIN file.
      Returns:
        element class

    - #### createCollectionTable

          public static <T> GbinStarTable createCollectionTable(GbinTableProfile profile,
                                                                java.lang.Class<T> gobjClazz,
                                                                java.util.Collection<? extends T> gobjList)

      Returns a table instance based on a collection of gaia objects. The returned table is not random access.

      A random-access implementation is possible, but trying to implement `getCell` efficiently would be a bit fiddly because of the way that column values are extracted.

      Parameters:
        `profile` - configures how Gaia objects will be mapped to columns
        `gobjClazz` - class of all objects representing rows
        `gobjList` - collection of typed objects, one for each table row
      Returns:
        sequential-access table based on array of gaia objects