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(Object[] o)
Create a binary table from existing data in column order.
|
BinaryTable(Object[][] data)
Create a binary table from existing data in row order.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addColumn(Object o)
Add a column to the end of a table.
|
int |
addFlattenedColumn(Object o,
int[] dims)
Add a column where the data is already flattened.
|
int |
addRow(Object[] o)
Add a row at the end of the table.
|
void |
fillHeader(Header h)
Modify a header to point to this data
|
Class[] |
getBases() |
Object |
getColumn(int col)
Get a given column
|
Object |
getData()
Return the data array object.
|
int[][] |
getDimens() |
Object |
getElement(int i,
int j)
Get a particular element from the table.
|
Object[] |
getFlatColumns() |
Object |
getFlattenedColumn(int col)
Get a column in flattened format.
|
int |
getHeapOffset() |
int |
getHeapSize() |
int |
getNCols()
Get the number of columns in the table.
|
int |
getNRows()
Get the number of rows in the table
|
Object[] |
getRow(int row)
Get a given row
|
int[] |
getSizes() |
static int[] |
getTDims(String tdims)
Parse the TDIMS value.
|
int |
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 |
readTrueData(ArrayDataInput i)
Read table, heap and padding
|
void |
setColumn(int col,
Object xcol)
Replace a column in the table.
|
void |
setElement(int i,
int j,
Object o)
Replace a single element within the table.
|
void |
setFlattenedColumn(int col,
Object data)
Set a column with the data aleady flattened.
|
void |
setRow(int row,
Object[] data)
Replace a row in the table.
|
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, rewrite, rewriteable, setFileOffsetpublic BinaryTable()
throws FitsException
FitsExceptionpublic BinaryTable(Header myHeader) throws FitsException
header - A header describing what the binary
table should look like.FitsExceptionpublic BinaryTable(Object[][] data) throws FitsException
data - The data used to initialize the binary table.FitsExceptionpublic BinaryTable(Object[] o) throws FitsException
FitsExceptionpublic BinaryTable(ColumnTable tab)
public static int[] getTDims(String tdims)
tdims - The value of the TDIMSn card.arraySize - The size field found on the TFORMn card.public void fillHeader(Header h) throws FitsException
DataFitsExceptionpublic Object[] getRow(int row) throws FitsException
getRow in interface TableDatarow - The index of the row to be returned.FitsExceptionpublic void setRow(int row,
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,
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,
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 Object getColumn(int col) throws FitsException
getColumn in interface TableDatacol - The index of the column.FitsExceptionpublic Object getFlattenedColumn(int col) throws FitsException
col - FitsExceptionpublic Object getElement(int i, int j) throws FitsException
getElement in interface TableDatai - The row of the element.j - The column of the element.FitsExceptionpublic int addRow(Object[] o) throws FitsException
addRow in interface TableDatao - An array of objects instantiating the data. These
should have the same structure as any existing rows.FitsExceptionpublic int addColumn(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(Object o, int[] dims) throws FitsException
o - The new column data. This should be a one-dimensional
primitive array.dimens - 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,
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
FitsExceptionpublic int 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 Object getData() throws FitsException
DatagetData in class DataFitsExceptionpublic int[][] getDimens()
public Class[] getBases()
public char[] getTypes()
public Object[] getFlatColumns()
public int[] getSizes()
public int getHeapSize()
public int getHeapOffset()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.