uk.ac.starlink.ttools.filter
Class JELColumnSupplement

java.lang.Object
  extended by uk.ac.starlink.ttools.filter.JELColumnSupplement
All Implemented Interfaces:
ColumnSupplement

public class JELColumnSupplement
extends Object
implements ColumnSupplement

ColumnSupplement that generates new columns based on JEL expressions.

Since:
27 Mar 2012
Author:
Mark Taylor

Constructor Summary
JELColumnSupplement(StarTable inTable, String[] exprs, ColumnInfo[] colInfos)
          Constructs a multiple-column JEL column supplement.
JELColumnSupplement(StarTable inTable, String expr, ColumnInfo colInfo)
          Constructs a single-column JEL column supplement.
 
Method Summary
 SupplementSequence createSequence(RowSequence rseq)
          Returns a new iterator over the values in the columns defined by this object.
 Object getCell(long irow, int icol)
          Random access read of a cell defined by this object.
 int getColumnCount()
          Returns the number of columns defined by this object.
 ColumnInfo getColumnInfo(int icol)
          Returns the column metadata object for a given column.
 Object[] getRow(long irow)
          Random access read of a row defined by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JELColumnSupplement

public JELColumnSupplement(StarTable inTable,
                           String[] exprs,
                           ColumnInfo[] colInfos)
                    throws IOException
Constructs a multiple-column JEL column supplement.

Parameters:
inTable - table providing JEL context
exprs - JEL expressions for columns
colInfos - metadata for columns (data types may be changed to match expression output); if null, names are generated automatically
Throws:
IOException - with a helpful message if one of the expressions cannot be compiled

JELColumnSupplement

public JELColumnSupplement(StarTable inTable,
                           String expr,
                           ColumnInfo colInfo)
                    throws IOException
Constructs a single-column JEL column supplement.

Parameters:
inTable - table providing JEL context
expr - JEL expression for column
colInfo - metadata for column (data type may be changed to match expression output); if null, name is generated automatically
Throws:
IOException
Method Detail

getColumnCount

public int getColumnCount()
Description copied from interface: ColumnSupplement
Returns the number of columns defined by this object.

Specified by:
getColumnCount in interface ColumnSupplement
Returns:
number of columns

getColumnInfo

public ColumnInfo getColumnInfo(int icol)
Description copied from interface: ColumnSupplement
Returns the column metadata object for a given column.

Specified by:
getColumnInfo in interface ColumnSupplement
Parameters:
icol - column index within this object
Returns:
column metadata for the icol'th column defined by this object

getCell

public Object getCell(long irow,
                      int icol)
               throws IOException
Description copied from interface: ColumnSupplement
Random access read of a cell defined by this object.

Specified by:
getCell in interface ColumnSupplement
Parameters:
irow - row index
icol - column index
Returns:
cell content
Throws:
IOException

getRow

public Object[] getRow(long irow)
                throws IOException
Description copied from interface: ColumnSupplement
Random access read of a row defined by this object.

Specified by:
getRow in interface ColumnSupplement
Parameters:
irow - row index
Returns:
array of cell contents for all the cells in this row
Throws:
IOException

createSequence

public SupplementSequence createSequence(RowSequence rseq)
Description copied from interface: ColumnSupplement
Returns a new iterator over the values in the columns defined by this object. The supplied row sequence must be from an appropriate host table; if not, behaviour is undefined.

Specified by:
createSequence in interface ColumnSupplement
Parameters:
rseq - row sequence providing data from the host table
Returns:
iterator over row data from supplementary columns


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.