eap.fits
Class FitsBinTableData

java.lang.Object
  extended byeap.fits.FitsData
      extended byeap.fits.FitsTableData
          extended byeap.fits.FitsBinTableData
All Implemented Interfaces:
TableModel

public class FitsBinTableData
extends FitsTableData

Represents BINTABLE format data. The superclass handles basic column information common between ASCII and binary tables and casts the data as a Java TableModel. This class handles the actual reading of the data. You use the TableModel getValueAt and setValueAt methods to interact with the table. These are geared toward use in a JTable, so they discard exceptions, and do not give alot of support for vector columns. I should probably add a few methods to compensate for this. The number of elements in a variable length vector column can't be changed That could be fixed, but there are some tricky issues to shuffling the heap around efficiently.


Field Summary
 
Fields inherited from class eap.fits.FitsData
data, interpreter, isComplete, PADDING, setter, valid_bytes
 
Constructor Summary
FitsBinTableData(FitsHeader header)
          Create a new table from the given header.
 
Method Summary
 Object getValueAt(int row, int col)
          Return the value for a given row and column.
 void setValueAt(Object value, int row, int col)
          Set a value in the table.
 
Methods inherited from class eap.fits.FitsTableData
addTableModelListener, findColumn, fireTableModelEvent, fireTableModelEvent, getColumn, getColumnClass, getColumnCount, getColumnName, getRowCount, goToElement, isCellEditable, removeTableModelListener
 
Methods inherited from class eap.fits.FitsData
available, blockCount, createFrom, data, goToByte, incrementValidBytes, isComplete, setValidBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsBinTableData

public FitsBinTableData(FitsHeader header)
                 throws FitsException
Create a new table from the given header.

Parameters:
header - HDU header whose keywords are used to set up the table structure. Note that the header is not saved internally, so modifications to the header after this constructor is called do not affect objects of this class.
Method Detail

getValueAt

public Object getValueAt(int row,
                         int col)
Return the value for a given row and column. This method is to satisfy the contract for the TableModel interface It catches FitsExceptions and returns a null pointer if there is an error.

Parameters:
row - the desired row counting from zero
col - the desired column counting from zero.
Returns:
the tabel value. This can be a Number, Boolean, String, List or null. Lists are used to return vector elements and null is returned if there is an error in the FITS format of the table.

setValueAt

public void setValueAt(Object value,
                       int row,
                       int col)
Set a value in the table. This method is to satisfy the contract for the TableModel interface. It makes its best attempt to interpret the value object in a format appropriate to the column. In particular, strings are parsed as numbers or booleans if need be, and vector columns can be specified as a bracketed, comma-separated list of strings (i.e. [value1, value2, value2, ...] ). In general, this method should accept the data representations from a JTable displaying this table. This method should probably be modified to accept a List or array for vector columns, but that has yet to be necessary. If the value cannot be properly formatted, or if there is trouble with the FITS format, this method silently ignores the requested update.

Parameters:
value - This is the value to write to the table.
row - the row index counting from zero.
col - the column index counting from zero.