uk.ac.starlink.fits
Class ColFitsTableWriter

java.lang.Object
  extended byuk.ac.starlink.table.StreamStarTableWriter
      extended byuk.ac.starlink.fits.AbstractFitsTableWriter
          extended byuk.ac.starlink.fits.ColFitsTableWriter
All Implemented Interfaces:
StarTableWriter

public class ColFitsTableWriter
extends AbstractFitsTableWriter

Handles writing of a StarTable in a column-oriented FITS binary table format. The table data is stored in a BINTABLE extension which has a single row; each cell in this row contains the data for an entire column of the represented table.

This rather specialised format may provide good performance for certain operations on very large, especially very wide, tables. Although it is FITS and can therefore be used in principle for data interchange, in practice most non-STIL processors are unlikely to be able to do much useful with it.

Since:
21 Jun 2006

Constructor Summary
ColFitsTableWriter()
           
 
Method Summary
protected  FitsTableSerializer createSerializer(StarTable table)
          Provides a suitable serializer for a given table.
 boolean looksLikeFile(String location)
          Indicates whether the destination is of a familiar form for this kind of writer.
 void writePrimaryHDU(StarTable table, FitsTableSerializer fitser, DataOutput out)
          Writes the primary HDU.
 
Methods inherited from class uk.ac.starlink.fits.AbstractFitsTableWriter
addMetadata, getCurrentDate, getFormatName, getMimeType, setFormatName, writeStarTable, writeTableHDU
 
Methods inherited from class uk.ac.starlink.table.StreamStarTableWriter
writeStarTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColFitsTableWriter

public ColFitsTableWriter()
Method Detail

looksLikeFile

public boolean looksLikeFile(String location)
Description copied from interface: StarTableWriter
Indicates whether the destination is of a familiar form for this kind of writer. This may be used to guess what kind of format a table should be written in. Implementations should return true for values of location which look like the normal form for their output format, for instance one with the usual file extension.

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

writePrimaryHDU

public void writePrimaryHDU(StarTable table,
                            FitsTableSerializer fitser,
                            DataOutput out)
                     throws IOException
Description copied from class: AbstractFitsTableWriter
Writes the primary HDU. This cannot contain the table since BINTABLE HDUs can only be extensions.

Specified by:
writePrimaryHDU in class AbstractFitsTableWriter
Parameters:
table - the table which will be written into the next HDU
fitser - fits serializer initialised from table
out - destination stream
Throws:
IOException

createSerializer

protected FitsTableSerializer createSerializer(StarTable table)
                                        throws IOException
Description copied from class: AbstractFitsTableWriter
Provides a suitable serializer for a given table.

Specified by:
createSerializer in class AbstractFitsTableWriter
Parameters:
table - table to serialize
Returns:
FITS serializer
Throws:
IOException

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.