public interface JepExpressionFunction extends JepFunction
Expression
that
can be used in queries.Jep.formulaToExpression(String, JepFunction[])
Modifier and Type | Method and Description |
---|---|
Expression |
toExpression(Node node)
Convert this function to an
Expression that can be used
in a query. |
getFunctionName
checkNumberOfParameters, getNumberOfParameters, run, setCurNumberOfParameters
Expression toExpression(Node node)
Expression
that can be used
in a query. The implementation must check that the node contains
the correct number of children (ie. arguments to the function)
and convert the arguments to whatever is suitable for the expression.
Example from the Log2Function
int numChildren = node.jjtGetNumChildren(); if (numChildren != 1) { throw new BaseException("Invalid number of arguments for 'log2' function: " + numChildren); } return Expressions.log2(Jep.nodeToExpression(node.jjtGetChild(0)));
node
- The node representing this functionExpression
object