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, BinaryTable.SaveState
-
Field Summary
Fields inherited from class nom.tam.fits.Data
dataSize, fileOffset, input
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 TypeMethodDescriptionprotected BinaryTable
asBinaryTable
(BinaryTable toTable, Header compressedHeader, Header targetHeader) (for internal use) No longer used, and it may be removed in the future.void
(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) Describe the structure of this data object in the supplied header.protected final int
Returns the number of original (uncompressed) table rows that are compressed as a block into a single compressed table row.void
prepareUncompressedData
(ColumnTable<?> data) Deprecated.protected void
setColumnCompressionAlgorithms
(String[] columnCompressionAlgorithms) (for internal use) Visibility may be reduced to the package level.protected CompressedTableData
setRowsPerTile
(int value) (for internal use) Visibility may be reduced to the package level.Methods inherited from class nom.tam.fits.BinaryTable
addBitsColumn, addByteVaryingColumn, addColumn, addColumn, addComplexColumn, addFlattenedColumn, addRow, addStringColumn, addVariableSizeColumn, clone, compact, containsHeap, convertToBits, copy, createColumnDataFor, createColumnTable, createTable, deleteColumns, deleteRows, discardVLAs, fromColumnMajor, fromRowMajor, get, getArrayElement, getArrayElementAs, getBases, getColumn, getCurrentData, getData, getDescriptor, getDescriptor, getDescriptor, getDimens, getDouble, getElement, getFlatColumns, getFlattenedColumn, getFromHeap, getLogical, getLong, getModelRow, getNCols, getNRows, getNumber, getRawElement, getRow, getSizes, getString, getTrueSize, getTypes, indexOf, loadData, parseTDims, read, readHeap, readHeap, readTrueData, reserveHeapSpace, reserveRowSpace, set, setColumn, setComplexColumn, setElement, setFlattenedColumn, setRow, toHDU, updateAfterDelete, validColumn, validRow, write
Methods inherited from class nom.tam.fits.Data
calcChecksum, detach, ensureData, getFileOffset, getKernel, getRandomAccessInput, getSize, isDeferred, isEmpty, reset, rewrite, rewriteable, setFileOffset
Methods inherited from class java.lang.Object
equals, finalize, 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
Description copied from class:Data
Describe the structure of this data object in the supplied header.- Overrides:
fillHeader
in classBinaryTable
- Parameters:
h
- header to fill with the data from the current data object- Throws:
FitsException
- if the operation fails
-
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
-
asBinaryTable
protected BinaryTable asBinaryTable(BinaryTable toTable, Header compressedHeader, Header targetHeader) throws FitsException (for internal use) No longer used, and it may be removed in the future.- Throws:
FitsException
-
getRowsPerTile
protected final int getRowsPerTile()Returns the number of original (uncompressed) table rows that are compressed as a block into a single compressed table row.- Returns:
- the number of table rows compressed together as a block.
-
setColumnCompressionAlgorithms
(for internal use) Visibility may be reduced to the package level. This should only be called byCompressedTableHDU
. -
setRowsPerTile
(for internal use) Visibility may be reduced to the package level. This should only be called byCompressedTableHDU
.
-
CompressedTableHDU
, and its visibility will be reduced accordingly in the future, not to mention that it should take a BinaryTable as its argument.