Class FastEvaluator

java.lang.Object
com.singularsys.jep.standard.FastEvaluator
All Implemented Interfaces:
Evaluator, GenericVisitor<Object,Void,EvaluationException>, JepComponent, Serializable
Direct Known Subclasses:
MonitoringEvaluator, ThreadSafeEvaluator

public class FastEvaluator extends Object implements Evaluator, GenericVisitor<Object,Void,EvaluationException>
A fast evaluator for Jep expressions. This is the default evaluator used by Jep.

It differs from StandardEvaluator in the evaluation of functions. It uses the UnaryFunction.eval(Object), BinaryFunction.eval(Object, Object), NaryBinaryFunction.eval(Object, Object), NaryFunction.eval(Object[]) methods instead of the PostfixMathCommandI.run(Stack) method. It can be up-to 6 times generally faster than the StandardEvaluator but if most functions don't use these interfaces then it can be marginally slower.

The UncheckedEvaluator uses a similar approach but does fewer intermediate checks and is about 5% faster than this class.

Since Jep 4.1, extension 2.2, this now implements GenericVisitor some method signatures have changed to be more specific.

Since:
Jep 3.3
See Also: