public abstract class TableHDU<T extends AbstractTableData> extends BasicHDU<T>
BITPIX_BYTE, BITPIX_DOUBLE, BITPIX_FLOAT, BITPIX_INT, BITPIX_LONG, BITPIX_SHORT, isPrimary, myData, myHeader
Modifier | Constructor and Description |
---|---|
protected |
TableHDU(Header hdr,
T td)
Create the TableHDU.
|
Modifier and Type | Method and Description |
---|---|
int |
addColumn(Object newCol)
Add a column to the table without any associated header information.
|
int |
addRow(Object[] newRows)
Add a row to the end of the table.
|
protected abstract IFitsHeader[] |
columnKeyStems() |
void |
deleteColumnsIndexOne(int column,
int len)
Delete a set of columns from a table.
|
void |
deleteColumnsIndexOne(int column,
int len,
String[] fields)
Delete a set of columns from a table.
|
void |
deleteColumnsIndexZero(int column,
int len)
Delete a set of columns from a table.
|
void |
deleteColumnsIndexZero(int column,
int len,
IFitsHeader[] fields)
Delete a set of columns from a table.
|
void |
deleteRows(int row)
Remove all rows from the table starting at some specific index from the
table.
|
void |
deleteRows(int firstRow,
int nRow)
Remove a number of adjacent rows from the table.
|
int |
findColumn(String colName)
Find the 0-based column index corresponding to a particular column name.
|
Object |
getColumn(int col) |
Object |
getColumn(String colName) |
String |
getColumnFormat(int index)
Get the FITS type of a column in the table.
|
String |
getColumnMeta(int index,
String type)
Convenience method for getting column data.
|
String |
getColumnName(int index)
Get the name of a column in the table.
|
Object[] |
getColumns() |
Object |
getElement(int row,
int col) |
int |
getNCols()
Get the number of columns for this table
|
int |
getNRows()
Get the number of rows for this table
|
Object[] |
getRow(int row) |
void |
setColumn(int col,
Object newCol)
Update a column within a table.
|
void |
setColumn(String colName,
Object newCol)
Update a column within a table.
|
void |
setColumnMeta(int index,
IFitsHeader key,
String value,
String comment,
boolean after)
Specify column metadata for a given column in a way that allows all of
the column metadata for a given column to be organized together.
|
void |
setColumnMeta(int index,
String key,
boolean value,
String comment,
boolean after) |
void |
setColumnMeta(int index,
String key,
double value,
String comment,
boolean after) |
void |
setColumnMeta(int index,
String key,
long value,
String comment,
boolean after) |
void |
setColumnMeta(int index,
String key,
String value,
String comment) |
void |
setColumnMeta(int index,
String key,
String value,
String comment,
boolean after)
Deprecated.
|
void |
setColumnName(int index,
String name,
String comment) |
void |
setCurrentColumn(int col)
Set the cursor in the header to point after the metadata for the
specified column
|
void |
setCurrentColumn(int col,
boolean after)
Set the cursor in the header to point either before the TFORM value or
after the column metadat
|
void |
setElement(int row,
int col,
Object element)
Update a single element within the table.
|
void |
setRow(int row,
Object[] newRow)
Update a row within a table.
|
addValue, addValue, addValue, addValue, addValue, addValue, addValue, addValue, card, getAuthor, getAxes, getBitPix, getBlankValue, getBScale, getBUnit, getBZero, getCreationDate, getData, getDummyHDU, getEpoch, getEquinox, getFileOffset, getGroupCount, getHeader, getInstrument, getKernel, getMaximumValue, getMinimumValue, getObject, getObservationDate, getObserver, getOrigin, getParameterCount, getReference, getSize, getTelescope, getTrimmedString, getTrimmedString, info, isData, isHeader, read, reset, rewrite, rewriteable, saveReplaceCard, write
public int addColumn(Object newCol) throws FitsException
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).FitsException
- if the operation failedpublic int addRow(Object[] newRows) throws FitsException
newRows
- rows to add to the tableFitsException
- if the operation failedprotected abstract IFitsHeader[] columnKeyStems()
public void deleteColumnsIndexOne(int column, int len) throws FitsException
column
- The one-indexed start column.len
- The number of columns to delete.FitsException
- if the operation failedpublic void deleteColumnsIndexOne(int column, int len, String[] fields) throws FitsException
column
- The one-indexed start column.len
- The number of columns to delete.fields
- Stems for the header fields to be removed for the table.FitsException
- if the operation failedpublic void deleteColumnsIndexZero(int column, int len) throws FitsException
column
- The one-indexed start column.len
- The number of columns to delete.FitsException
- if the operation failedpublic void deleteColumnsIndexZero(int column, int len, IFitsHeader[] fields) throws FitsException
column
- The zero-indexed start column.len
- The number of columns to delete.fields
- Stems for the header fields to be removed for the table.FitsException
- if the operation failedpublic void deleteRows(int row) throws FitsException
row
- the (0-based) index of the first row to be deleted.FitsException
- if an error occurs.public void deleteRows(int firstRow, int nRow) throws FitsException
firstRow
- the (0-based) index of the first row to be deleted. This is
zero-based indexing: 0<=firstrow< number of rows.nRow
- the total number of rows to be deleted.FitsException
- If an error occurs in the deletion.public int findColumn(String colName)
colName
- the name of the columnpublic Object getColumn(int col) throws FitsException
col
- column index to getFitsException
- if the operation failedpublic Object getColumn(String colName) throws FitsException
colName
- The name of the column to be extracted.FitsException
- if the operation failedpublic String getColumnFormat(int index) throws FitsException
index
- The 0-based index of the column.FitsException
- if an invalid index was requested.public String getColumnMeta(int index, String type)
index
- index of the columtype
- the key type to getpublic String getColumnName(int index)
index
- The 0-based column index.public Object[] getColumns() throws FitsException
FitsException
- if the operation failedpublic Object getElement(int row, int col) throws FitsException
row
- the row index of the elementcol
- the column index of the elementFitsException
- if the operation failedpublic int getNCols()
public int getNRows()
public Object[] getRow(int row) throws FitsException
row
- the index of the row to retreiveFitsException
- if the operation failedpublic void setColumn(int col, Object newCol) throws FitsException
col
- index of the column to replacenewCol
- the replacement columnFitsException
- if the operation failedpublic void setColumn(String colName, Object newCol) throws FitsException
colName
- name of the column to replacenewCol
- the replacement columnFitsException
- if the operation failedpublic void setColumnMeta(int index, IFitsHeader key, String value, String comment, boolean after) throws FitsException
index
- The 0-based index of the columnkey
- The column key. I.e., the keyword will be key+(index+1)value
- The value to be placed in the header.comment
- The comment for the headerafter
- Should the header card be after the current column metadata
block (true), or immediately before the TFORM card (false). @throws
FitsException if the operation failedFitsException
- if the header could not be updatedpublic void setColumnMeta(int index, String key, boolean value, String comment, boolean after) throws FitsException
FitsException
public void setColumnMeta(int index, String key, double value, String comment, boolean after) throws FitsException
FitsException
public void setColumnMeta(int index, String key, long value, String comment, boolean after) throws FitsException
FitsException
public void setColumnMeta(int index, String key, String value, String comment) throws FitsException
FitsException
@Deprecated public void setColumnMeta(int index, String key, String value, String comment, boolean after) throws FitsException
setColumnMeta(int, IFitsHeader, String, String, boolean)
index
- The 0-based index of the columnkey
- The column key. I.e., the keyword will be key+(index+1)value
- The value to be placed in the header.comment
- The comment for the headerafter
- Should the header card be after the current column metadata
block (true), or immediately before the TFORM card (false). @throws
FitsException if the operation failedFitsException
- if the header could not be updatedpublic void setColumnName(int index, String name, String comment) throws FitsException
FitsException
public void setCurrentColumn(int col)
col
- The 0-based index of the columnpublic void setCurrentColumn(int col, boolean after)
col
- The 0-based index of the columnafter
- True if the cursor should be placed after the existing column
metadata or false if the cursor is to be placed before the
TFORM value. If no corresponding TFORM is found, the cursoe
will be placed at the end of current header.public void setElement(int row, int col, Object element) throws FitsException
row
- the row indexcol
- the column indexelement
- the replacement elementFitsException
- if the operation failedpublic void setRow(int row, Object[] newRow) throws FitsException
row
- row indexnewRow
- the replacement rowFitsException
- if the operation failedCopyright © 1996–2016 nom-tam-fits. All rights reserved.