Classes that implement the built-in functions and operators.
There are several base classes and interfaces which can be used:
- {@link com.singularsys.jep.PostfixMathCommandI}
- The basic interface all functions should implement. Defines a
void run(Stack<Object> aStack)
method.
- {@link com.singularsys.jep.functions.PostfixMathCommand}
- Base class for most functions
- {@link com.singularsys.jep.functions.UnaryFunction}
- Base class for unary functions, just need to implement a
Object eval(Object arg)
method.
- {@link com.singularsys.jep.functions.BinaryFunction}
- Base class for binary functions, just need to implement
Object eval(Object l,Object r)
method.
- {@link com.singularsys.jep.functions.NaryBinaryFunction}
- Base class for n-ary functions backed by an associative operation like +,*. just need to implement
Object eval(Object l,Object r)
method.
- {@link com.singularsys.jep.functions.CallbackEvaluationI}
- Interface for classes which need access to the parse-tree, for example lazy evaluation
functions like && and || which do not need to evaluate all their arguments, or assignment operators which need access to a variable and not just its value.
The {@link com.singularsys.jep.reals} package also define some interfaces for functions which take double
arguments and
return double
results, which can be quicker in special purpose evaluators.