public class Function extends Node
Modifier and Type | Class and Description |
---|---|
static interface |
Function.Dynamic
Add this annotation on functions that don't always return the same value
for the same inputs and on functions with side-effects.
|
Modifier and Type | Method and Description |
---|---|
RValue |
bindVariables(Expression expression,
boolean preferLValue) |
double |
getValue() |
char |
id()
Returns a character that helps identify the token, pseudo-token or invokable in question.
|
protected static double |
invokeMethod(java.lang.reflect.Method method,
java.lang.Object[] args) |
RValue |
optimize() |
java.lang.String |
toString() |
getPosition
public final double getValue() throws EvaluationException
EvaluationException
protected static double invokeMethod(java.lang.reflect.Method method, java.lang.Object[] args) throws EvaluationException
EvaluationException
public char id()
Identifiable
Tokens: i - IdentifierToken 0 - NumberToken o - OperatorToken \0 - NullToken CharacterTokens are returned literally PseudoTokens: p - UnaryOperator V - UnboundVariable Nodes: c - Constant v - Variable f - Function l - LValueFunction s - Sequence I - Conditional w - While F - For r - Return b - Break (includes continue) S - SimpleFor C - Switch
public RValue optimize() throws EvaluationException
optimize
in interface RValue
optimize
in class Node
EvaluationException
public RValue bindVariables(Expression expression, boolean preferLValue) throws ParserException
bindVariables
in interface RValue
bindVariables
in class Node
ParserException