public class AsciiTable extends Data implements TableData
dataSize, fileOffset, input
Constructor and Description |
---|
AsciiTable()
Create an empty ASCII table
|
AsciiTable(Header hdr)
Create an ASCII table given a header
|
Modifier and Type | Method and Description |
---|---|
int |
addColumn(Object newCol)
Add a row to the table.
|
int |
addColumn(Object newCol,
int length)
This version of addColumn allows the user to override
the default length associated with each column type.
|
int |
addRow(Object[] newRow)
Add a row to the FITS table.
|
void |
fillHeader(Header hdr)
Fill in a header with information that points to this
data.
|
Object |
getColumn(int col)
Get a column of data
|
Object |
getData()
Get the ASCII table information.
|
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
|
Object[] |
getRow(int row)
Get a row.
|
int |
getRowLen()
Get the number of bytes in a row
|
protected int |
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,
Object newData)
Replace a column with new data.
|
void |
setElement(int row,
int col,
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,
Object[] newData)
Modify a row in the table
|
void |
write(ArrayDataOutput str)
Write the data to an output stream.
|
getFileOffset, getKernel, getSize, rewrite, rewriteable, setFileOffset
public AsciiTable(Header hdr) throws FitsException
FitsException
public AsciiTable()
public void read(ArrayDataInput str) throws FitsException
read
in interface FitsElement
read
in class Data
str
- The input data streamFitsException
public Object getData() throws FitsException
getData
in class Data
FitsException
public Object getColumn(int col) throws FitsException
getColumn
in interface TableData
FitsException
public Object[] getRow(int row) throws FitsException
getRow
in interface TableData
FitsException
public Object getElement(int row, int col) throws FitsException
getElement
in interface TableData
FitsException
public void write(ArrayDataOutput str) throws FitsException
write
in interface FitsElement
write
in class Data
str
- The output stream on which to write the data.FitsException
public void setColumn(int col, Object newData) throws FitsException
setColumn
in interface TableData
FitsException
public void setRow(int row, Object[] newData) throws FitsException
setRow
in interface TableData
FitsException
public void setElement(int row, int col, Object newData) throws FitsException
setElement
in interface TableData
FitsException
public void setNull(int row, int col, boolean flag)
public boolean isNull(int row, int col)
public int addColumn(Object newCol) throws FitsException
addColumn
in interface TableData
FitsException
public int addColumn(Object newCol, int length) throws FitsException
FitsException
public int addRow(Object[] newRow) throws FitsException
addRow
in interface TableData
FitsException
protected int getTrueSize()
public void fillHeader(Header hdr)
public int getNRows()
public int getNCols()
public int getRowLen()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.