uk.ac.starlink.feather

## Class FeatherStarTable

- java.lang.Object
- - uk.ac.starlink.table.AbstractStarTable
  - - uk.ac.starlink.feather.FeatherStarTable

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

      public class FeatherStarTable
      extends AbstractStarTable

  Adaptor from FeatherTable to StarTable.
  Since:
    26 Feb 2020

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DESCRIPTION_KEY` JSON key used to store description text in column user metadata.
    `static ValueInfo` | `FTYPE_INFO` Aux metadata key for column feather type value.
    `static java.lang.String` | `META_KEY` JSON key to store miscellaneous/broken metadata in column metadata.
    `static java.lang.String` | `SHAPE_KEY` JSON key to store stringified array shape in column user metadata.
    `static java.lang.String` | `UCD_KEY` JSON key used to store UCDs in column user metadata.
    `static java.lang.String` | `UNIT_KEY` JSON key used to store units in column user metadata.
    `static java.lang.String` | `UTYPE_KEY` JSON key used to store Utypes in column user metadata.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeatherStarTable(uk.ac.bristol.star.feather.FeatherTable ftable)` Constructs a FeatherStarTable from a FeatherTable.
    `FeatherStarTable(java.io.File file)` Constructs a FeatherStarTable from a File.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Does nothing, but perhaps it ought to try to clear up resources related to the mapped buffers.
    `java.lang.Object` | `getCell(long irow, int icol)` The `AbstractStarTable` implementation of this method throws an `UnsupportedOperationException`, since unless otherwise provided there is no random access.
    `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.String` | `getName()` Returns the name of this table, if it has one.
    `java.lang.Object` | `getRow(long irow, int icol)`
    `RowAccess` | `getRowAccess()` Returns an object which can provide random access to this table's data, if random access is implemented.
    `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.
    `boolean` | `isRandom()` The `AbstractStarTable` implementation of this method returns `false`.

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

      `checkedLongToInt, getColumnAuxDataInfos, getParameters, getRow, getRowSplittable, getURL, 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`

- - ### Field Detail

    - #### UCD_KEY

          public static final java.lang.String UCD_KEY

      JSON key used to store UCDs in column user metadata.
      See Also:
        Constant Field Values

    - #### UTYPE_KEY

          public static final java.lang.String UTYPE_KEY

      JSON key used to store Utypes in column user metadata.
      See Also:
        Constant Field Values

    - #### UNIT_KEY

          public static final java.lang.String UNIT_KEY

      JSON key used to store units in column user metadata.
      See Also:
        Constant Field Values

    - #### DESCRIPTION_KEY

          public static final java.lang.String DESCRIPTION_KEY

      JSON key used to store description text in column user metadata.
      See Also:
        Constant Field Values

    - #### SHAPE_KEY

          public static final java.lang.String SHAPE_KEY

      JSON key to store stringified array shape in column user metadata.
      See Also:
        Constant Field Values

    - #### META_KEY

          public static final java.lang.String META_KEY

      JSON key to store miscellaneous/broken metadata in column metadata.
      See Also:
        Constant Field Values

    - #### FTYPE_INFO

          public static final ValueInfo FTYPE_INFO

      Aux metadata key for column feather type value.

  - ### Constructor Detail

    - #### FeatherStarTable

          public FeatherStarTable(uk.ac.bristol.star.feather.FeatherTable ftable)

      Constructs a FeatherStarTable from a FeatherTable.
      Parameters:
        `ftable` - feather table object

    - #### FeatherStarTable

          public FeatherStarTable(java.io.File file)
                           throws java.io.IOException

      Constructs a FeatherStarTable from a File.
      Parameters:
        `file` - file
      Throws:
        `java.io.IOException`

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

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `StarTable`
      Returns the name of this table, if it has one. The meaning of the name is not defined, but it will typically be a short string of text indicating the identity of this table.
      Specified by:
        `getName` in interface `StarTable`
      Overrides:
        `getName` in class `AbstractStarTable`
      Returns:
        a name for this table, or `null` if no suitable one exists

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

    - #### getCell

          public java.lang.Object getCell(long irow,
                                          int icol)
                                   throws java.io.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:
        `irow` - the index of the cell's row
        `icol` - the index of the cell's column
      Returns:
        the contents of this cell
      Throws:
        `java.io.IOException` - if there is an error reading the data

    - #### getRow

          public java.lang.Object getRow(long irow,
                                         int icol)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getRowSequence

          public RowSequence getRowSequence()

      Description copied from interface: `StarTable`
      Returns an object which can iterate over all the rows in the table sequentially. Each such returned object is safe for use within a single thread, but not in general from multiple threads concurrently.
      Specified by:
        `getRowSequence` in interface `StarTable`
      Specified by:
        `getRowSequence` in class `AbstractStarTable`
      Returns:
        new RowSequence

    - #### getRowAccess

          public RowAccess getRowAccess()

      Description copied from interface: `StarTable`
      Returns an object which can provide random access to this table's data, if random access is implemented. Each such returned object is safe for use within a single thread, but not in general from multiple threads concurrently.
      Specified by:
        `getRowAccess` in interface `StarTable`
      Overrides:
        `getRowAccess` in class `AbstractStarTable`
      Returns:
        new RowAccess

    - #### close

          public void close()
                     throws java.io.IOException

      Does nothing, but perhaps it ought to try to clear up resources related to the mapped buffers.
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Specified by:
        `close` in interface `StarTable`
      Overrides:
        `close` in class `AbstractStarTable`
      Throws:
        `java.io.IOException`