Class JELColumnSupplement
java.lang.Object
uk.ac.starlink.ttools.filter.JELColumnSupplement
- All Implemented Interfaces:
ColumnSupplement
ColumnSupplement that generates new columns based on JEL expressions.
- Since:
- 27 Mar 2012
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionJELColumnSupplement(uk.ac.starlink.table.StarTable inTable, String[] exprs, uk.ac.starlink.table.ColumnInfo[] colInfos) Constructs a multiple-column JEL column supplement.JELColumnSupplement(uk.ac.starlink.table.StarTable inTable, String expr, uk.ac.starlink.table.ColumnInfo colInfo) Constructs a single-column JEL column supplement. -
Method Summary
Modifier and TypeMethodDescriptioncreateSupplementData(uk.ac.starlink.table.RowData rdata) Returns a new accessor for the values in the columns defined by this object.getCell(long irow, int icol) Random access read of a cell defined by this object.intReturns the number of columns defined by this object.uk.ac.starlink.table.ColumnInfogetColumnInfo(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.
-
Constructor Details
-
JELColumnSupplement
public JELColumnSupplement(uk.ac.starlink.table.StarTable inTable, String[] exprs, uk.ac.starlink.table.ColumnInfo[] colInfos) throws IOException Constructs a multiple-column JEL column supplement.- Parameters:
inTable- table providing JEL contextexprs- JEL expressions for columnscolInfos- 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(uk.ac.starlink.table.StarTable inTable, String expr, uk.ac.starlink.table.ColumnInfo colInfo) throws IOException Constructs a single-column JEL column supplement.- Parameters:
inTable- table providing JEL contextexpr- JEL expression for columncolInfo- metadata for column (data type may be changed to match expression output); if null, name is generated automatically- Throws:
IOException
-
-
Method Details
-
getColumnCount
public int getColumnCount()Description copied from interface:ColumnSupplementReturns the number of columns defined by this object.- Specified by:
getColumnCountin interfaceColumnSupplement- Returns:
- number of columns
-
getColumnInfo
public uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol) Description copied from interface:ColumnSupplementReturns the column metadata object for a given column.- Specified by:
getColumnInfoin interfaceColumnSupplement- Parameters:
icol- column index within this object- Returns:
- column metadata for the icol'th column defined by this object
-
getCell
Description copied from interface:ColumnSupplementRandom access read of a cell defined by this object.- Specified by:
getCellin interfaceColumnSupplement- Parameters:
irow- row indexicol- column index- Returns:
- cell content
- Throws:
IOException
-
getRow
Description copied from interface:ColumnSupplementRandom access read of a row defined by this object.- Specified by:
getRowin interfaceColumnSupplement- Parameters:
irow- row index- Returns:
- array of cell contents for all the cells in this row
- Throws:
IOException
-
createSupplementData
Description copied from interface:ColumnSupplementReturns a new accessor for the values in the columns defined by this object. The supplied row object must be from an appropriate host table; if not, behaviour is undefined.- Specified by:
createSupplementDatain interfaceColumnSupplement- Parameters:
rdata- row accessor providing data from the host table- Returns:
- accessor over row data from supplementary columns
- Throws:
IOException
-