org.jacorb.idl
Class ConstExprEvaluator
java.lang.Object
org.jacorb.idl.ConstExprEvaluator
public class ConstExprEvaluator
extends java.lang.Object
Based on the MathEvaluator class by The-Son LAI,
Lts@writeme.com
Expression evaluator for IDL constant expression
Supports the following functions:
+, -, *, /, ^, %, ^, | , <<, >>
When the getValue() is called, a Double object is returned.
If it returns null, an error occured.
Version:
- Gerald Brose,
The-Son LAI Lts@writeme.com
ConstExprEvaluator
public ConstExprEvaluator()
creates an empty ConstExprEvaluator.
You need to use setExpression(String s) to assign an expression string to it.
ConstExprEvaluator
public ConstExprEvaluator(String s)
creates a ConstExprEvaluator and assign the expression string.
getValue
public Double getValue()
evaluates and returns the value of the expression
getVariable
public Double getVariable(String s)
gets the variable's value that was assigned previously
reset
public void reset()
resets the evaluator
setExpression
public void setExpression(String s)
sets the expression