uk.ac.starlink.ttools
Class JELSelectorTable

java.lang.Object
  |
  +--uk.ac.starlink.table.WrapperStarTable
        |
        +--uk.ac.starlink.ttools.JELSelectorTable
All Implemented Interfaces:
StarTable

public class JELSelectorTable
extends WrapperStarTable

Sequential table which selects rows on the basis of a JEL-interpreted expression.

See Also:
JELRowReader

Field Summary
 
Fields inherited from class uk.ac.starlink.table.WrapperStarTable
baseTable
 
Constructor Summary
JELSelectorTable(StarTable baseTable, String expr)
          Construct a table given a base table and a selection expression.
 
Method Summary
 long getRowCount()
          Returns the number of rows in this table, if known.
 RowSequence getRowSequence()
          Returns an object which can iterate over all the rows in the table sequentially.
 boolean isRandom()
          Indicates whether random access is provided by this table.
 
Methods inherited from class uk.ac.starlink.table.WrapperStarTable
checkedLongToInt, getBaseTable, getCell, getColumnAuxDataInfos, getColumnCount, getColumnInfo, getName, getParameterByName, getParameters, getRow, getURL, setName, setParameter, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JELSelectorTable

public JELSelectorTable(StarTable baseTable,
                        String expr)
                 throws gnu.jel.CompilationException
Construct a table given a base table and a selection expression.

Parameters:
baseTable - base table
expr - boolean algebraic expression describing inclusion test
Method Detail

isRandom

public boolean isRandom()
Description copied from interface: StarTable
Indicates whether random access is provided by this table. Only if the result is true may the StarTable.getRow(long) and StarTable.getCell(long, int) methods be used.

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

getRowCount

public long getRowCount()
Description copied from interface: StarTable
Returns the number of rows in this table, if known. If the number of rows cannot be (easily) determined, a value of -1 will be returned.

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

getRowSequence

public RowSequence getRowSequence()
                           throws 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:
IOException - if there is an error providing access

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