public class BinaryTable extends Data implements TableData
dataSize, fileOffset, input| Constructor and Description |
|---|
BinaryTable()
Create a null binary table data segment.
|
BinaryTable(ColumnTable tab)
Create a binary table from an existing ColumnTable
|
BinaryTable(Header myHeader)
Create a binary table from given header information.
|
BinaryTable(java.lang.Object[] o)
Create a binary table from existing data in column order.
|
BinaryTable(java.lang.Object[][] data)
Create a binary table from existing data in row order.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addColumn(java.lang.Object o)
Add a column to the end of a table.
|
int |
addFlattenedColumn(java.lang.Object o,
int[] dims)
Add a column where the data is already flattened.
|
int |
addRow(java.lang.Object[] o)
Add a row at the end of the table.
|
void |
deleteColumns(int start,
int len)
Delete a set of columns.
|
void |
deleteRows(int row,
int len)
Delete rows from a table.
|
void |
fillHeader(Header h)
Update a FITS header to reflect the current state of the data.
|
java.lang.Class[] |
getBases() |
java.lang.Object |
getColumn(int col)
Get a given column
|
java.lang.Object |
getData()
Return the data array object.
|
int[][] |
getDimens() |
java.lang.Object |
getElement(int i,
int j)
Get a particular element from the table.
|
java.lang.Object[] |
getFlatColumns() |
java.lang.Object |
getFlattenedColumn(int col)
Get a column in flattened format.
|
int |
getHeapOffset()
What is the offset to the heap
|
int |
getHeapSize()
What is the size of the heap -- including the offset from the end of the
table data.
|
java.lang.Object[] |
getModelRow()
Return a row that may be used for direct i/o to the table.
|
int |
getNCols()
Get the number of columns in the table.
|
int |
getNRows()
Get the number of rows in the table
|
java.lang.Object |
getRawElement(int i,
int j)
Get a particular element from the table but
do no processing of this element (e.g.,
dimension conversion or extraction of
variable length array elements/)
|
java.lang.Object[] |
getRow(int row)
Get a given row
|
int[] |
getSizes() |
static int[] |
getTDims(java.lang.String tdims)
Parse the TDIMS value.
|
long |
getTrueSize()
Get the size of the data in the HDU sans padding.
|
char[] |
getTypes() |
void |
read(ArrayDataInput i)
Read the data -- or defer reading on random access
|
protected void |
readHeap(ArrayDataInput input)
Read the heap which contains the data for variable length
arrays.
|
protected void |
readTrueData(ArrayDataInput i)
Read table, heap and padding
|
void |
setColumn(int col,
java.lang.Object xcol)
Replace a column in the table.
|
void |
setElement(int i,
int j,
java.lang.Object o)
Replace a single element within the table.
|
void |
setFlattenedColumn(int col,
java.lang.Object data)
Set a column with the data aleady flattened.
|
void |
setRow(int row,
java.lang.Object[] data)
Replace a row in the table.
|
void |
updateAfterDelete(int oldNcol,
Header hdr)
Update the header after a deletion.
|
protected boolean |
validColumn(int j)
Check if the column number is valid.
|
protected boolean |
validRow(int i)
Check to see if this is a valid row.
|
void |
write(ArrayDataOutput os)
Write the table, heap and padding
|
getFileOffset, getKernel, getSize, reset, rewrite, rewriteable, setFileOffsetpublic BinaryTable()
throws FitsException
FitsExceptionpublic BinaryTable(Header myHeader) throws FitsException
myHeader - A header describing what the binary
table should look like.FitsExceptionpublic BinaryTable(java.lang.Object[][] data)
throws FitsException
data - The data used to initialize the binary table.FitsExceptionpublic BinaryTable(java.lang.Object[] o)
throws FitsException
FitsExceptionpublic BinaryTable(ColumnTable tab)
public java.lang.Object[] getModelRow()
public static int[] getTDims(java.lang.String tdims)
tdims - The value of the TDIMSn card.public void fillHeader(Header h) throws FitsException
FitsExceptionpublic java.lang.Object[] getRow(int row)
throws FitsException
getRow in interface TableDatarow - The index of the row to be returned.FitsExceptionpublic void setRow(int row,
java.lang.Object[] data)
throws FitsException
setRow in interface TableDatarow - The index of the row to be replaced.data - The new values for the row.FitsException - Thrown if the new row cannot
match the existing data.public void setColumn(int col,
java.lang.Object xcol)
throws FitsException
setColumn in interface TableDatacol - The index of the column to be replaced.xcol - The new data for the columnFitsException - Thrown if the data does not match
the current column description.public void setFlattenedColumn(int col,
java.lang.Object data)
throws FitsException
col - The index of the column to be replaced.data - The new data array. This should be a one-d
primitive array.FitsException - Thrown if the type of length of
the replacement data differs from the
original.public java.lang.Object getColumn(int col)
throws FitsException
getColumn in interface TableDatacol - The index of the column.FitsExceptionpublic java.lang.Object getFlattenedColumn(int col)
throws FitsException
col - FitsExceptionpublic java.lang.Object getElement(int i,
int j)
throws FitsException
getElement in interface TableDatai - The row of the element.j - The column of the element.FitsExceptionpublic java.lang.Object getRawElement(int i,
int j)
throws FitsException
i - The row of the element.j - The column of the element.FitsExceptionpublic int addRow(java.lang.Object[] o)
throws FitsException
addRow in interface TableDatao - An array of elements to be added. Each element of o
should be an array of primitives or a String.FitsExceptionpublic void deleteRows(int row,
int len)
throws FitsException
deleteRows in interface TableDatarow - The 0-indexed start of the rows to be deleted.len - The number of rows to be deleted.FitsExceptionpublic int addColumn(java.lang.Object o)
throws FitsException
addColumn in interface TableDatao - An array of identically structured objects with the
same number of elements as other columns in the table.FitsExceptionpublic int addFlattenedColumn(java.lang.Object o,
int[] dims)
throws FitsException
o - The new column data. This should be a one-dimensional
primitive array.dims - The dimensions of one row of the column.FitsExceptionpublic int getNRows()
public int getNCols()
protected boolean validRow(int i)
i - The Java index (first=0) of the row to check.protected boolean validColumn(int j)
j - The Java index (first=0) of the column to check.public void setElement(int i,
int j,
java.lang.Object o)
throws FitsException
setElement in interface TableDatai - The row of the data.j - The column of the data.o - The replacement data.FitsExceptionpublic void read(ArrayDataInput i) throws FitsException
read in interface FitsElementread in class Datai - The input data streamFitsExceptionprotected void readTrueData(ArrayDataInput i) throws FitsException
FitsExceptionprotected void readHeap(ArrayDataInput input) throws FitsException
FitsExceptionpublic long getTrueSize()
public void write(ArrayDataOutput os) throws FitsException
write in interface FitsElementwrite in class Dataos - The output stream on which to write the data.FitsExceptionpublic java.lang.Object getData()
throws FitsException
DatagetData in class DataFitsExceptionpublic int[][] getDimens()
public java.lang.Class[] getBases()
public char[] getTypes()
public java.lang.Object[] getFlatColumns()
public int[] getSizes()
public int getHeapSize()
public int getHeapOffset()
public void deleteColumns(int start,
int len)
throws FitsException
deleteColumns in interface TableDataFitsExceptionpublic void updateAfterDelete(int oldNcol,
Header hdr)
throws FitsException
updateAfterDelete in interface TableDataFitsException