Class CompressedTableData
- All Implemented Interfaces:
Cloneable
,FitsElement
,TableData
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class nom.tam.fits.BinaryTable
BinaryTable.ColumnDesc
-
Constructor Summary
ConstructorDescriptionCreates a new empty compressed table data to be initialized at a later pointCompressedTableData
(Header header) Creates a new compressed table data based on the prescription of the supplied header. -
Method Summary
Modifier and TypeMethodDescriptionvoid
(for internal use) This should only be called byCompressedTableHDU
, and should have reduced visibility accordingly.long
Defragments the heap area of this table, compacting the heap area, and returning the number of bytes by which the heap size has been reduced.void
fillHeader
(Header h) void
prepareUncompressedData
(ColumnTable<?> data) Deprecated.Methods inherited from class nom.tam.fits.BinaryTable
addBitsColumn, addColumn, addColumn, addComplexColumn, addFlattenedColumn, addRow, addStringColumn, addVariableSizeColumn, compact, containsHeap, convertToBits, copy, createColumnDataFor, deleteColumns, deleteRows, fromColumnMajor, fromRowMajor, get, getArrayElement, getArrayElementAs, getBases, getColumn, getData, getDescriptor, getDescriptor, getDescriptor, getDimens, getDouble, getElement, getFlatColumns, getFlattenedColumn, getLogical, getLong, getModelRow, getNCols, getNRows, getNumber, getRawElement, getRow, getSizes, getString, getTypes, indexOf, parseTDims, read, reserveHeapSpace, reserveRowSpace, set, setColumn, setComplexColumn, setElement, setFlattenedColumn, setRow, toHDU, updateAfterDelete, write
Methods inherited from class nom.tam.fits.Data
calcChecksum, detach, getFileOffset, getKernel, getSize, isDeferred, isEmpty, reset, rewrite, rewriteable
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nom.tam.fits.TableData
addRowEntries, setRowEntries
-
Constructor Details
-
CompressedTableData
public CompressedTableData()Creates a new empty compressed table data to be initialized at a later point -
CompressedTableData
Creates a new compressed table data based on the prescription of the supplied header.- Parameters:
header
- The header that describes the compressed table- Throws:
FitsException
- If the header is invalid or could not be accessed.
-
-
Method Details
-
compress
(for internal use) This should only be called byCompressedTableHDU
, and should have reduced visibility accordingly.- Parameters:
header
- the compressed header- Throws:
FitsException
- if the table cannot be compressed.
-
defragment
Description copied from class:BinaryTable
Defragments the heap area of this table, compacting the heap area, and returning the number of bytes by which the heap size has been reduced. When tables with variable-sized columns are modified, the heap may retain old data as columns are removed or elements get replaced with new data of different size. The data order in the heap may also get jumbled, causing what would appear to be sequential reads to jump all over the heap space with the caching. And, depending on how the heap was constructed in the first place, it may not be optimal for the row-after-row table access that is the most typical use case.
This method rebuilds the heap by taking elements in table read order (by rows, and columns) and puts them on a new heap.
For best squential read performance, you should defragment all tables that have been built column-by-column before writing them to a FITS file. The only time defragmentation is really not needed is if the table was built row-by-row, with no modifications to variable-length content after the fact.
- Overrides:
defragment
in classBinaryTable
- Returns:
- the number of bytes by which the heap has shrunk as a result of defragmentation.
- Throws:
FitsException
- if there was an error accessing the heap or the main data table comntaining the heap locators. In case of an error the table content may be left in a damaged state.- See Also:
-
fillHeader
- Overrides:
fillHeader
in classBinaryTable
- Throws:
FitsException
-
prepareUncompressedData
Deprecated.(for internal use) This should only be called byCompressedTableHDU
, and its visibility will be reduced accordingly in the future, not to mention that it should take a BinaryTable as its argument.- Parameters:
data
- The original (uncompressed) table data.- Throws:
FitsException
-
CompressedTableHDU
, and its visibility will be reduced accordingly in the future, not to mention that it should take a BinaryTable as its argument.