uk.ac.starlink.pds4

## Class BasePds4StarTable

- java.lang.Object
- - uk.ac.starlink.table.AbstractStarTable
  - - uk.ac.starlink.pds4.Pds4StarTable
    - - uk.ac.starlink.pds4.BasePds4StarTable

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

      public class BasePds4StarTable
      extends Pds4StarTable

  Concrete Pds4StarTable subclass for fixed-length-record (binary and character) PDS tables.
  Since:
    24 Nov 2021

- - ### Field Summary

    - ### Fields inherited from class uk.ac.starlink.pds4.Pds4StarTable

      `DESCRIPTION_INFO`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasePds4StarTable(BaseTable table, java.net.URI contextUri)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `getCell(long lrow, 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.Object[]` | `getRow(long lrow)` The `AbstractStarTable` implementation of this method constructs a row by repeated invocation of `AbstractStarTable.getCell(long, int)`.
    `RowAccess` | `getRowAccess()` Returns an object which can provide random access to this table's data, if random access is implemented.
    `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.pds4.Pds4StarTable

      `getRowCount`

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

      `checkedLongToInt, close, getColumnAuxDataInfos, getName, getParameters, 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`

- - ### Constructor Detail

    - #### BasePds4StarTable

          public BasePds4StarTable(BaseTable table,
                                   java.net.URI contextUri)
                            throws java.io.IOException

      Constructor.
      Parameters:
        `table` - table object on which this table is based
        `contextUri` - parent URI for the PDS4 label
      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

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

    - #### getRowSequence

          public RowSequence getRowSequence()
                                     throws java.io.IOException

      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
      Throws:
        `java.io.IOException` - if there is an error providing access

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

    - #### getRow

          public java.lang.Object[] getRow(long lrow)
                                    throws java.io.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:
        `java.io.IOException` - if there is an error reading the data

    - #### getCell

          public java.lang.Object getCell(long lrow,
                                          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:
        `lrow` - 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

    - #### getRowAccess

          public RowAccess getRowAccess()
                                 throws java.io.IOException

      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
      Throws:
        `java.io.IOException` - if there is an error setting up access