public abstract class AbstractFitsTableWriter
extends uk.ac.starlink.table.StreamStarTableWriter
implements uk.ac.starlink.table.MultiStarTableWriter
A couple of Auxiliary metadata items of the ColumnInfo metadata from written tables are respected:
Tables.NULL_VALUE_INFO:
sets the value of TNULLn "magic" blank value for
integer columnsTables.UBYTE_FLAG_INFO:
if set to Boolean.TRUE and if the column has content class
Short or short[], the data will be written
as unsigned bytes (TFORMn='B')
not 16-bit signed integers (TFORMn='I').| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFitsTableWriter(java.lang.String formatName)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMetadata(nom.tam.fits.Header hdr)
Adds some standard metadata header cards to a FITS table header.
|
protected abstract FitsTableSerializer |
createSerializer(uk.ac.starlink.table.StarTable table)
Provides a suitable serializer for a given table.
|
static java.lang.String |
getCurrentDate()
Returns an ISO-8601 data string representing the time at which this
method is called.
|
java.lang.String |
getFormatName() |
java.lang.String |
getMimeType()
Returns "application/fits".
|
void |
setFormatName(java.lang.String formatName)
Sets the declared format name.
|
void |
writePrimaryHDU(java.io.DataOutput out)
Writes the primary HDU.
|
void |
writeStarTable(uk.ac.starlink.table.StarTable table,
java.io.OutputStream out)
Writes a single table.
|
void |
writeStarTables(uk.ac.starlink.table.TableSequence tableSeq,
java.io.OutputStream out)
Writes tables.
|
void |
writeStarTables(uk.ac.starlink.table.TableSequence tableSeq,
java.lang.String location,
uk.ac.starlink.table.StarTableOutput sto)
|
void |
writeTableHDU(uk.ac.starlink.table.StarTable table,
FitsTableSerializer fitser,
java.io.DataOutput out)
Writes a data HDU.
|
protected AbstractFitsTableWriter(java.lang.String formatName)
formatName - format namepublic java.lang.String getFormatName()
getFormatName in interface uk.ac.starlink.table.StarTableWriterpublic void setFormatName(java.lang.String formatName)
formatName - format namepublic java.lang.String getMimeType()
getMimeType in interface uk.ac.starlink.table.StarTableWriterpublic void writeStarTable(uk.ac.starlink.table.StarTable table,
java.io.OutputStream out)
throws java.io.IOException
writeStarTables(uk.ac.starlink.table.TableSequence, java.io.OutputStream).writeStarTable in interface uk.ac.starlink.table.StarTableWriterjava.io.IOExceptionpublic void writeStarTables(uk.ac.starlink.table.TableSequence tableSeq,
java.io.OutputStream out)
throws java.io.IOException
writePrimaryHDU(java.io.DataOutput)
to write the primary HDU.
Subclasses which want to put something related to the input tables
into the primary HDU will need to override this method
(writeStarTables).writeStarTables in interface uk.ac.starlink.table.MultiStarTableWriterjava.io.IOExceptionpublic void writeStarTables(uk.ac.starlink.table.TableSequence tableSeq,
java.lang.String location,
uk.ac.starlink.table.StarTableOutput sto)
throws java.io.IOException
writeStarTables in interface uk.ac.starlink.table.MultiStarTableWriterjava.io.IOExceptionpublic void writePrimaryHDU(java.io.DataOutput out)
throws java.io.IOException
out - destination streamjava.io.IOExceptionpublic void writeTableHDU(uk.ac.starlink.table.StarTable table,
FitsTableSerializer fitser,
java.io.DataOutput out)
throws java.io.IOException
table - the table to be written into the HDUfitser - fits serializer initalised from tableout - destination streamjava.io.IOExceptionprotected abstract FitsTableSerializer createSerializer(uk.ac.starlink.table.StarTable table) throws java.io.IOException
table - table to serializejava.io.IOException - if the table can't be writtenprotected void addMetadata(nom.tam.fits.Header hdr)
hdr - header to modifypublic static java.lang.String getCurrentDate()
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.