uk.ac.starlink.feather

## Class StarColumnWriter

- java.lang.Object
- - uk.ac.starlink.feather.StarColumnWriter

- All Implemented Interfaces:
    uk.ac.bristol.star.feather.FeatherColumnWriter
  Direct Known Subclasses:
    BooleanStarColumnWriter, NumberStarColumnWriter, VariableStarColumnWriter

      public abstract class StarColumnWriter
      extends java.lang.Object
      implements uk.ac.bristol.star.feather.FeatherColumnWriter

  FeatherColumnWriter for use with StarTables.
  Since:
    26 Feb 2020

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StarColumnWriter.DataStat` Aggregates information about column output.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `StarColumnWriter(StarTable table, int icol, uk.ac.bristol.star.feather.FeatherType featherType, boolean isNullable)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ItemAccumulator` | `createItemAccumulator(StoragePolicy storage)`
    `int` | `getColumnIndex()` Returns the index of the input table column which is being written.
    `uk.ac.bristol.star.feather.FeatherType` | `getFeatherType()` Returns the output data type code.
    `java.lang.String` | `getName()`
    `StarTable` | `getTable()` Returns the table on which this writer is operating.
    `java.lang.String` | `getUserMetadata()`
    `boolean` | `isNullable()` Indicates whether this writer may write a validity mask.
    `uk.ac.bristol.star.feather.ColStat` | `writeColumnBytes(java.io.OutputStream out)`
    `abstract StarColumnWriter.DataStat` | `writeDataBytes(java.io.OutputStream out)` Writes the bytes consituting the data stream for this column, excluding any optional validity mask.

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

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

- - ### Constructor Detail

    - #### StarColumnWriter

          protected StarColumnWriter(StarTable table,
                                     int icol,
                                     uk.ac.bristol.star.feather.FeatherType featherType,
                                     boolean isNullable)

      Constructor. The `isNullable` parameter only needs to be given true if the writeData method cannot represent null values in its byte representation.
      Parameters:
        `table` - inupt table
        `icol` - column index in input table
        `featherType` - data type for output column
        `isNullable` - true iff writeData cannot write in-band null values

  - ### Method Detail

    - #### writeDataBytes

          public abstract StarColumnWriter.DataStat writeDataBytes(java.io.OutputStream out)
                                                            throws java.io.IOException

      Writes the bytes consituting the data stream for this column, excluding any optional validity mask. Note the output does not need to be aligned on an 8-byte boundary.
      Parameters:
        `out` - destination stream
      Returns:
        information about what was actually written
      Throws:
        `java.io.IOException`

    - #### getTable

          public StarTable getTable()

      Returns the table on which this writer is operating.
      Returns:
        input table

    - #### getColumnIndex

          public int getColumnIndex()

      Returns the index of the input table column which is being written.
      Returns:
        input column index

    - #### getFeatherType

          public uk.ac.bristol.star.feather.FeatherType getFeatherType()

      Returns the output data type code.
      Specified by:
        `getFeatherType` in interface `uk.ac.bristol.star.feather.FeatherColumnWriter`
      Returns:
        feather output type

    - #### isNullable

          public boolean isNullable()

      Indicates whether this writer may write a validity mask.
      Returns:
        true iff output type supports masked null values

    - #### getName

          public java.lang.String getName()

      Specified by:
        `getName` in interface `uk.ac.bristol.star.feather.FeatherColumnWriter`

    - #### getUserMetadata

          public java.lang.String getUserMetadata()

      Specified by:
        `getUserMetadata` in interface `uk.ac.bristol.star.feather.FeatherColumnWriter`

    - #### writeColumnBytes

          public uk.ac.bristol.star.feather.ColStat writeColumnBytes(java.io.OutputStream out)
                                                              throws java.io.IOException

      Specified by:
        `writeColumnBytes` in interface `uk.ac.bristol.star.feather.FeatherColumnWriter`
      Throws:
        `java.io.IOException`

    - #### createItemAccumulator

          public abstract ItemAccumulator createItemAccumulator(StoragePolicy storage)