uk.ac.starlink.fits
Class FitsStarTable

java.lang.Object
  |
  +--uk.ac.starlink.table.AbstractStarTable
        |
        +--uk.ac.starlink.table.RandomStarTable
              |
              +--uk.ac.starlink.fits.FitsStarTable
All Implemented Interfaces:
StarTable

public class FitsStarTable
extends RandomStarTable

An implementation of the StarTable interface which uses FITS TABLE or BINTABLE extensions.

This implementation uses the table handling in the nom.tam.fits package. I think that performance could be considerably improved by rewriting the table access from scratch. The reason for this is largely that the nom.tam.fits classes do a lot of wrapping of values in (perhaps multi-dimensional) arrays, which is not for our purposes necessary. Such a re-implementation would take a bit of effort unfortunately.


Constructor Summary
FitsStarTable(TableHDU thdu)
          Constructs a FitsStarTable object from a FITS TableHDU object.
 
Method Summary
 Object getCell(long lrow, int icol)
          The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access.
 List getColumnAuxDataInfos()
          Goes through the table columns (ColumnInfo objects) and picks out all the AuxData items which exist, generalising where necessary and returning a union of them in alphabetical order by name.
 int getColumnCount()
          Returns the number of columns in this table.
 ColumnInfo getColumnInfo(int icol)
          Returns the object describing the data in a given column.
 Object[] getRow(long lrow)
          The AbstractStarTable implementation of this method constructs a row by repeated invocation of getCell(long, int).
 long getRowCount()
          The number of rows in this table.
 
Methods inherited from class uk.ac.starlink.table.RandomStarTable
getRowSequence, isRandom
 
Methods inherited from class uk.ac.starlink.table.AbstractStarTable
checkedLongToInt, getName, getParameterByName, getParameters, getURL, setName, setParameter, setParameters, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitsStarTable

public FitsStarTable(TableHDU thdu)
              throws IOException
Constructs a FitsStarTable object from a FITS TableHDU object.

Parameters:
thdu - a TableHDU object containing data
Method Detail

getRowCount

public long getRowCount()
Description copied from class: RandomStarTable
The number of rows in this table. Implementations must supply a non-negative return value.

Specified by:
getRowCount in interface StarTable
Specified by:
getRowCount in class RandomStarTable
Returns:
the number of rows in the table

getColumnCount

public int getColumnCount()
Description copied from interface: StarTable
Returns the number of columns in this table.

Specified by:
getColumnCount in interface StarTable
Specified by:
getColumnCount in class AbstractStarTable
Returns:
the number of columns

getColumnInfo

public ColumnInfo getColumnInfo(int icol)
Description copied from interface: StarTable
Returns the object describing the data in a given column.

Specified by:
getColumnInfo in interface StarTable
Specified by:
getColumnInfo in class AbstractStarTable
Parameters:
icol - the column for which header information is required
Returns:
a ValueInfo object for column icol

getColumnAuxDataInfos

public List getColumnAuxDataInfos()
Description copied from class: AbstractStarTable
Goes through the table columns (ColumnInfo objects) and picks out all the AuxData items which exist, generalising where necessary and returning a union of them in alphabetical order by name. Subclasses should override this if they can do better, for instance providing an order for the keys.

Specified by:
getColumnAuxDataInfos in interface StarTable
Overrides:
getColumnAuxDataInfos in class AbstractStarTable
Returns:
a list of all the auxiliary metadata ValueInfo items which in fact crop up in column metadata

getCell

public Object getCell(long lrow,
                      int icol)
               throws IOException
Description copied from class: AbstractStarTable
The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access.

Specified by:
getCell in interface StarTable
Overrides:
getCell in class AbstractStarTable
Parameters:
lrow - the index of the cell's row
icol - the index of the cell's column
Returns:
the contents of this cell
Throws:
IOException - if there is an error reading the data

getRow

public Object[] getRow(long lrow)
                throws IOException
Description copied from class: AbstractStarTable
The AbstractStarTable implementation of this method constructs a row by repeated invocation of AbstractStarTable.getCell(long, int).

Specified by:
getRow in interface StarTable
Overrides:
getRow in class AbstractStarTable
Parameters:
lrow - the index of the row to retrieve
Returns:
an array of the objects in each cell in row irow
Throws:
IOException - if there is an error reading the data

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.