|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nom.tam.fits.Data nom.tam.fits.BinaryTable
public class BinaryTable
This class defines the methods for accessing FITS binary table data.
Field Summary |
---|
Fields inherited from class nom.tam.fits.Data |
---|
dataSize, fileOffset, input |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
fillHeader(Header h)
Modify a header to point to this 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()
|
int |
getHeapSize()
|
int |
getNCols()
Get the number of columns in the table. |
int |
getNRows()
Get the number of rows in the table |
java.lang.Object[] |
getRow(int row)
Get a given row |
int[] |
getSizes()
|
static int[] |
getTDims(java.lang.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,
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. |
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 |
Methods inherited from class nom.tam.fits.Data |
---|
getFileOffset, getKernel, getSize, rewrite, rewriteable, setFileOffset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryTable() throws FitsException
FitsException
public BinaryTable(Header myHeader) throws FitsException
header
- A header describing what the binary
table should look like.
FitsException
public BinaryTable(java.lang.Object[][] data) throws FitsException
data
- The data used to initialize the binary table.
FitsException
public BinaryTable(java.lang.Object[] o) throws FitsException
FitsException
public BinaryTable(ColumnTable tab)
Method Detail |
---|
public static int[] getTDims(java.lang.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
Data
FitsException
public java.lang.Object[] getRow(int row) throws FitsException
getRow
in interface TableData
row
- The index of the row to be returned.
FitsException
public void setRow(int row, java.lang.Object[] data) throws FitsException
setRow
in interface TableData
row
- 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 TableData
col
- The index of the column to be replaced.xcol
- The new data for the column
FitsException
- 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 TableData
col
- The index of the column.
FitsException
public java.lang.Object getFlattenedColumn(int col) throws FitsException
col
-
FitsException
public java.lang.Object getElement(int i, int j) throws FitsException
getElement
in interface TableData
i
- The row of the element.j
- The column of the element.
FitsException
public int addRow(java.lang.Object[] o) throws FitsException
addRow
in interface TableData
o
- An array of objects instantiating the data. These
should have the same structure as any existing rows.
FitsException
public int addColumn(java.lang.Object o) throws FitsException
addColumn
in interface TableData
o
- An array of identically structured objects with the
same number of elements as other columns in the table.
FitsException
public int addFlattenedColumn(java.lang.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.
FitsException
public int getNRows()
getNRows
in interface TableData
public int getNCols()
getNCols
in interface TableData
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 TableData
i
- The row of the data.j
- The column of the data.o
- The replacement data.
FitsException
public void read(ArrayDataInput i) throws FitsException
read
in interface FitsElement
read
in class Data
i
- The input data stream
FitsException
protected void readTrueData(ArrayDataInput i) throws FitsException
FitsException
public int getTrueSize()
public void write(ArrayDataOutput os) throws FitsException
write
in interface FitsElement
write
in class Data
os
- The output stream on which to write the data.
FitsException
public java.lang.Object getData() throws FitsException
Data
getData
in class Data
FitsException
public int[][] getDimens()
public java.lang.Class[] getBases()
public char[] getTypes()
public java.lang.Object[] getFlatColumns()
public int[] getSizes()
public int getHeapSize()
public int getHeapOffset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |