|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnom.tam.fits.Data
nom.tam.fits.AsciiTable
public class AsciiTable
This class represents the data in an ASCII table
| Field Summary |
|---|
| Fields inherited from class nom.tam.fits.Data |
|---|
dataSize, fileOffset, input |
| Constructor Summary | |
|---|---|
AsciiTable()
Create an empty ASCII table |
|
AsciiTable(Header hdr)
Create an ASCII table given a header |
|
| Method Summary | |
|---|---|
int |
addColumn(java.lang.Object newCol)
Add a column to the table. |
int |
addColumn(java.lang.Object newCol,
int length)
This version of addColumn allows the user to override the default length associated with each column type. |
int |
addRow(java.lang.Object[] newRow)
Add a row to the FITS table. |
void |
deleteColumns(int start,
int len)
Delete columns from the table. |
void |
deleteRows(int start,
int len)
Delete rows from a FITS table |
void |
fillHeader(Header hdr)
Fill in a header with information that points to this data. |
java.lang.Object |
getColumn(int col)
Get a column of data |
java.lang.Object |
getData()
Get the ASCII table information. |
java.lang.Object |
getElement(int row,
int col)
Get a single element as a one-d array. |
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 row. |
int |
getRowLen()
Get the number of bytes in a row |
protected long |
getTrueSize()
Return the size of the data section |
boolean |
isNull(int row,
int col)
See if an element is null. |
void |
read(ArrayDataInput str)
Read in an ASCII table. |
void |
setColumn(int col,
java.lang.Object newData)
Replace a column with new data. |
void |
setElement(int row,
int col,
java.lang.Object newData)
Modify an element in the table |
void |
setNull(int row,
int col,
boolean flag)
Mark (or unmark) an element as null. |
void |
setRow(int row,
java.lang.Object[] newData)
Modify a row in the table |
void |
updateAfterDelete(int oldNCol,
Header hdr)
This is called after we delete columns. |
void |
write(ArrayDataOutput str)
Write the data to an output stream. |
| Methods inherited from class nom.tam.fits.Data |
|---|
getFileOffset, getKernel, getSize, reset, rewrite, rewriteable, setFileOffset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsciiTable(Header hdr)
throws FitsException
hdr - The header describing the table
FitsExceptionpublic AsciiTable()
| Method Detail |
|---|
public void read(ArrayDataInput str)
throws FitsException
read in interface FitsElementread in class Datastr -
FitsException
public java.lang.Object getData()
throws FitsException
getData in class DataFitsException
public java.lang.Object getColumn(int col)
throws FitsException
getColumn in interface TableDatacol - The 0-indexed column to be returned.
FitsException
public java.lang.Object[] getRow(int row)
throws FitsException
getRow in interface TableDatarow - The 0-indexed row to be returned.
FitsException
public java.lang.Object getElement(int row,
int col)
throws FitsException
getElement in interface TableDatarow - The 0-based rowcol - The 0-based column
FitsException - when unable to get the data.
public void write(ArrayDataOutput str)
throws FitsException
write in interface FitsElementwrite in class Datastr - The output stream to be written to
FitsException - if any IO exception is found or
some inconsistency the FITS file arises.
public void setColumn(int col,
java.lang.Object newData)
throws FitsException
setColumn in interface TableDatacol - The 0-based index to the columnnewData - The column data. This is typically a 1-d array.
FitsException
public void setRow(int row,
java.lang.Object[] newData)
throws FitsException
setRow in interface TableDatarow - The 0-based index of the rownewData - The new data. Each element of this array is typically
a primitive[1] array.
FitsException
public void setElement(int row,
int col,
java.lang.Object newData)
throws FitsException
setElement in interface TableDatarow - the 0-based rowcol - the 0-based columnnewData - The new value for the column. Typically a primitive[1] array.
FitsException
public void setNull(int row,
int col,
boolean flag)
row - The 0-based row.col - The 0-based column.flag - True if the element is to be set to null.
public boolean isNull(int row,
int col)
row - The 0-based rowcol - The 0-based column
public int addColumn(java.lang.Object newCol)
throws FitsException
addColumn in interface TableDatanewCol - the new column information. This is typically a
primitive[n] or String[n] array.
FitsException
public int addColumn(java.lang.Object newCol,
int length)
throws FitsException
newCol - The new column datalength - the requested length for the column
FitsException
public int addRow(java.lang.Object[] newRow)
throws FitsException
addRow in interface TableDatanewRow - The new row data.
FitsException
public void deleteRows(int start,
int len)
throws FitsException
deleteRows in interface TableDatastart - The first (0-indexed) row to be deleted.len - The number of rows to be deleted.
FitsExceptionprotected long getTrueSize()
public void fillHeader(Header hdr)
hdr - The header to be updated with information appropriate
to the current table data.public int getNRows()
getNRows in interface TableDatapublic int getNCols()
getNCols in interface TableDatapublic int getRowLen()
public void deleteColumns(int start,
int len)
throws FitsException
deleteColumns in interface TableDatastart - The first, 0-indexed, column to be deleted.len - The number of columns to be deleted.
FitsException
public void updateAfterDelete(int oldNCol,
Header hdr)
throws FitsException
updateAfterDelete in interface TableDataoldNCol - The number of columns we had before deletion.hdr - The associated header.
FitsException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||