uk.ac.starlink.fits

## Class VariableFitsTableWriter

- java.lang.Object
- - uk.ac.starlink.table.StreamStarTableWriter
  - - uk.ac.starlink.fits.AbstractFitsTableWriter
    - - uk.ac.starlink.fits.VariableFitsTableWriter

- All Implemented Interfaces:
    MultiStarTableWriter, StarTableWriter

      public class VariableFitsTableWriter
      extends AbstractFitsTableWriter

  TableWriter which writes FITS BINTABLEs with variable-length arrays where appropriate. Array-valued columns in the input StarTable which are declared with variable shapes (the last element of `ColumnInfo.getShape()` is negative) will be written in the output FITS file using the 'P' or 'Q' data type specifier with the actual data written in the BINTABLE extension heap - see the FITS document for details. Any other columns will get written in just the same way as by the `FitsTableWriter`.

  Strings and String arrays ('A' descriptor) are not currently written in variable-length form.

  Since:
    11 Jul 2008

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VariableFitsTableWriter()` Constructs a writer with default characteristics.
    `VariableFitsTableWriter(java.lang.Boolean longIndexing, boolean allowSignedByte, WideFits wide)` Deprecated. allows some configuration options but not others; use no-arg constructor and configuration methods instead

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected FitsTableSerializer` | `createSerializer(StarTable table)` Provides a suitable serializer for a given table.
    `java.lang.Boolean` | `getLongIndexing()` Indicates whether this writer will use P or Q format descriptors for writing variable-length arrays.
    `boolean` | `looksLikeFile(java.lang.String location)` Always returns false.
    `void` | `setLongIndexing(java.lang.Boolean longIndexing)` Sets whether this writer will use P or Q format descriptors for writing variable-length arrays.
    `void` | `setStoragePolicy(StoragePolicy storagePolicy)` Sets the storage policy which will be used for temporary storage during writing.

    - ### Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter

      `addMetadata, getAllowSignedByte, getAllowZeroLengthString, getConfig, getCurrentDate, getFormatName, getMimeType, getPadCharacter, getWide, getWriteDate, setAllowSignedByte, setAllowZeroLengthString, setFormatName, setPadCharacter, setWide, setWriteDate, writePrimaryHDU, writeStarTable, writeStarTables, writeStarTables, writeTableHDU`

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

      `writeStarTable, writeStarTable`

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

      `writeStarTable`

- - ### Constructor Detail

    - #### VariableFitsTableWriter

          public VariableFitsTableWriter()

      Constructs a writer with default characteristics. It chooses sensibly between using 'P' and 'Q' format.

    - #### VariableFitsTableWriter

          @Deprecated
          public VariableFitsTableWriter(java.lang.Boolean longIndexing,
                                                     boolean allowSignedByte,
                                                     WideFits wide)

      Deprecated. allows some configuration options but not others; use no-arg constructor and configuration methods instead
      Deprecated custom constructor.

  - ### Method Detail

    - #### setStoragePolicy

          public void setStoragePolicy(StoragePolicy storagePolicy)

      Sets the storage policy which will be used for temporary storage during writing. Temporary storage is required for the heap contents while the table body itself is being written. By default the system default storage policy is used.
      Parameters:
        `storagePolicy` - policy to use

    - #### setLongIndexing

          public void setLongIndexing(java.lang.Boolean longIndexing)

      Sets whether this writer will use P or Q format descriptors for writing variable-length arrays.
      Parameters:
        `longIndexing` - TRUE for 'Q' (64-bit) indexing into the heap, FALSE for 'P' (32-bit) indexing into the heap, null to make a sensible choice

    - #### getLongIndexing

          public java.lang.Boolean getLongIndexing()

      Indicates whether this writer will use P or Q format descriptors for writing variable-length arrays.
      Returns:
        TRUE for 'Q' (64-bit) indexing into the heap, FALSE for 'P' (32-bit) indexing into the heap, null to make a sensible choice

    - #### looksLikeFile

          public boolean looksLikeFile(java.lang.String location)

      Always returns false.
      Parameters:
        `location` - the location name (probably filename)
      Returns:
        `true` iff it looks like a file this writer would normally write

    - #### createSerializer

          protected FitsTableSerializer createSerializer(StarTable table)
                                                  throws java.io.IOException

      Description copied from class: `AbstractFitsTableWriter`
      Provides a suitable serializer for a given table. Note this should throw an IOException if it can be determined that the submitted table cannot be written by this writer, for instance if it has too many columns.
      Specified by:
        `createSerializer` in class `AbstractFitsTableWriter`
      Parameters:
        `table` - table to serialize
      Returns:
        FITS serializer
      Throws:
        `java.io.IOException` - if the table can't be written