public class SyntheticColumn
extends uk.ac.starlink.table.ColumnData
java.lang.Math
class. This list could be extended quite
easily if new arithmetic tricks were required.
The engine used for expression evaluation is the GNU Java Expressions Library (JEL).
Constructor and Description |
---|
SyntheticColumn(TopcatModel tcModel,
uk.ac.starlink.table.ColumnInfo cinfo,
String expression,
Class<?> resultType)
Constructs a new synthetic column from an algebraic expression
applied to a table.
|
Modifier and Type | Method and Description |
---|---|
String |
getExpression()
Returns the JEL expression that provides this column's value.
|
Object |
readValue(long lrow) |
void |
setExpression(String expression,
Class<?> resultType)
Sets the algebraic expression which this column uses to calculate
its results.
|
public SyntheticColumn(TopcatModel tcModel, uk.ac.starlink.table.ColumnInfo cinfo, String expression, Class<?> resultType) throws gnu.jel.CompilationException
tcModel
- context for JEL expression evaluationcinfo
- metadata for the new column;
note this object may be modified as required by
the supplied expressionexpression
- algebraic expression for the value of this
columnresultType
- a Class for the result, presumably one of the
primitive wrapper types or String.class. If null
a suitable class is chosen automatically.gnu.jel.CompilationException
public void setExpression(String expression, Class<?> resultType) throws gnu.jel.CompilationException
expression
- the string giving the algebraic exprssion for
this column's value in terms of other columnsresultType
- a Class for the result, presumably one of the
primitive wrapper types or String.class. If null
a suitable class is chosen automatically.gnu.jel.CompilationException
public String getExpression()
public Object readValue(long lrow) throws IOException
readValue
in class uk.ac.starlink.table.ColumnData
IOException
Copyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.