Package nom.tam.fits
Interface TableData
-
- All Known Implementing Classes:
AbstractTableData
,AsciiTable
,BinaryTable
,CompressedImageData
,CompressedTableData
public interface TableData
This class allows FITS binary and ASCII tables to be accessed via a common interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
addColumn(java.lang.Object newCol)
Add a column to the table without any associated header information.int
addRow(java.lang.Object[] newRow)
Add a row at the end of the table.void
deleteColumns(int row, int len)
void
deleteRows(int row, int len)
java.lang.Object
getColumn(int col)
java.lang.Object
getElement(int row, int col)
int
getNCols()
int
getNRows()
java.lang.Object[]
getRow(int row)
void
setColumn(int col, java.lang.Object newCol)
void
setElement(int row, int col, java.lang.Object element)
void
setRow(int row, java.lang.Object[] newRow)
void
updateAfterDelete(int oldNcol, Header hdr)
-
-
-
Method Detail
-
addColumn
int addColumn(java.lang.Object newCol) throws FitsException
Add a column to the table without any associated header information. Users should be cautious of calling this routine directly rather than the corresponding routine in AsciiTableHDU since this routine knows nothing of the FITS header modifications required.- Parameters:
newCol
- the new column information. the newCol should be an Object[] where type of all of the constituents is identical. The length of data should match the other columns. Note: It is valid for data to be a 2 or higher dimensionality primitive array. In this case the column index is the first (in Java speak) index of the array. E.g., if called with int[30][20][10], the number of rows in the table should be 30 and this column will have elements which are 2-d integer arrays with TDIM = (10,20).- Returns:
- the number of columns in the adapted table
- Throws:
FitsException
- if the operation failed
-
addRow
int addRow(java.lang.Object[] newRow) throws FitsException
Add a row at the end of the table. Given the way the table is structured this will normally not be very efficient.Users should be cautious of calling this routine directly rather than the corresponding routine in AsciiTableHDU since this routine knows nothing of the FITS header modifications required.- Parameters:
newRow
- An array of elements to be added. Each element of o should be an array of primitives or a String.- Returns:
- the number of rows in the adapted table
- Throws:
FitsException
- if the operation failed
-
deleteColumns
void deleteColumns(int row, int len) throws FitsException
- Throws:
FitsException
-
deleteRows
void deleteRows(int row, int len) throws FitsException
- Throws:
FitsException
-
getColumn
java.lang.Object getColumn(int col) throws FitsException
- Throws:
FitsException
-
getElement
java.lang.Object getElement(int row, int col) throws FitsException
- Throws:
FitsException
-
getNCols
int getNCols()
-
getNRows
int getNRows()
-
getRow
java.lang.Object[] getRow(int row) throws FitsException
- Throws:
FitsException
-
setColumn
void setColumn(int col, java.lang.Object newCol) throws FitsException
- Throws:
FitsException
-
setElement
void setElement(int row, int col, java.lang.Object element) throws FitsException
- Throws:
FitsException
-
setRow
void setRow(int row, java.lang.Object[] newRow) throws FitsException
- Throws:
FitsException
-
updateAfterDelete
void updateAfterDelete(int oldNcol, Header hdr) throws FitsException
- Throws:
FitsException
-
-