uk.ac.starlink.table
Class SelectorStarTable

java.lang.Object
  extended by uk.ac.starlink.table.WrapperStarTable
      extended by uk.ac.starlink.table.SelectorStarTable
All Implemented Interfaces:
StarTable

public abstract class SelectorStarTable
extends WrapperStarTable

Sequential wrapper table which selects only certain rows of its base table. No random access is provided, and the row sequence evaluates the abstract isIncluded(uk.ac.starlink.table.RowSequence) method for each row of the base table as it is iterated over.

Since:
11 Feb 2005

Field Summary
 
Fields inherited from class uk.ac.starlink.table.WrapperStarTable
baseTable
 
Constructor Summary
SelectorStarTable(StarTable baseTable)
          Constructor.
 
Method Summary
 java.lang.Object getCell(int icol)
           
 java.lang.Object[] getRow()
           
 long getRowCount()
          Returns -1 (length unknown).
 RowSequence getRowSequence()
          Returns an object which can iterate over all the rows in the table sequentially.
abstract  boolean isIncluded(RowSequence baseSeq)
          Evaluated to determine whether rows of the base table are included in this one.
 boolean isRandom()
          Returns false.
 
Methods inherited from class uk.ac.starlink.table.WrapperStarTable
checkedLongToInt, getBaseTable, getCell, getColumnAuxDataInfos, getColumnCount, getColumnInfo, getName, getParameterByName, getParameters, getRow, getURL, setName, setParameter, setURL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectorStarTable

public SelectorStarTable(StarTable baseTable)
Constructor.

Parameters:
baseTable - table on which this is based
Method Detail

isIncluded

public abstract boolean isIncluded(RowSequence baseSeq)
                            throws java.io.IOException
Evaluated to determine whether rows of the base table are included in this one.

Parameters:
baseSeq - row sequence of the base table
Returns:
true iff the current row of baseSeq is to be included
Throws:
java.io.IOException

isRandom

public boolean isRandom()
Returns false.

Specified by:
isRandom in interface StarTable
Overrides:
isRandom in class WrapperStarTable
Returns:
true if table random access methods are available

getRowCount

public long getRowCount()
Returns -1 (length unknown).

Specified by:
getRowCount in interface StarTable
Overrides:
getRowCount in class WrapperStarTable
Returns:
the number of rows, or -1

getRow

public java.lang.Object[] getRow()

getCell

public java.lang.Object getCell(int icol)

getRowSequence

public RowSequence getRowSequence()
                           throws java.io.IOException
Description copied from interface: StarTable
Returns an object which can iterate over all the rows in the table sequentially.

Specified by:
getRowSequence in interface StarTable
Overrides:
getRowSequence in class WrapperStarTable
Returns:
an object providing sequential access to the table data
Throws:
java.io.IOException - if there is an error providing access

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