Package com.singularsys.jep.reals
Class RealEvaluator
java.lang.Object
com.singularsys.jep.reals.RealEvaluator
- All Implemented Interfaces:
Evaluator,JepComponent,Serializable
Performs fast evaluation of expressions by using primitive types double and
boolean instead of objects.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEvaluates a sub expression.Main entry point, evaluates a node and returns and object with the value of the node.protected static doublefromObject(Object o) Gets a light-weight instance suitable for using in multiple threads.voidInitialize the component.protected doubleprotected double[]visitChildren(ASTFunNode node) protected doublevisitConstant(ASTConstant node) protected doublevisitFunction(ASTFunNode node) protected doublevisitVariable(ASTVarNode node)
-
Constructor Details
-
RealEvaluator
public RealEvaluator()
-
-
Method Details
-
evaluate
Description copied from interface:EvaluatorMain entry point, evaluates a node and returns and object with the value of the node.- Specified by:
evaluatein interfaceEvaluator- Parameters:
node- node to evaluate- Returns:
- value after evaluation
- Throws:
EvaluationException- if errors occur during evaluation;
-
eval
Description copied from interface:EvaluatorEvaluates a sub expression. This method can be called by PostfixMathCommands which implementCallbackEvaluationI- Specified by:
evalin interfaceEvaluator- Parameters:
node- node to evaluate- Returns:
- The value after evaluating the sub expression.
- Throws:
EvaluationException- if errors occur during evaluation;
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
visit
- Throws:
EvaluationException
-
visitChildren
- Throws:
EvaluationException
-
visitFunction
- Throws:
EvaluationException
-
visitVariable
- Throws:
EvaluationException
-
visitConstant
- Throws:
EvaluationException
-
fromObject
- Throws:
EvaluationException
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-