|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jacorb.idl.ConstExprEvaluator
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.
Nested Class Summary | |
protected class |
ConstExprEvaluator.Node
|
protected class |
ConstExprEvaluator.Operator
|
Field Summary | |
protected static ConstExprEvaluator.Operator[] |
operators
|
Constructor Summary | |
ConstExprEvaluator()
creates an empty ConstExprEvaluator. |
|
ConstExprEvaluator(java.lang.String s)
creates a ConstExprEvaluator and assign the expression string. |
Method Summary | |
protected ConstExprEvaluator.Operator[] |
getOperators()
|
java.lang.Double |
getValue()
evaluates and returns the value of the expression |
java.lang.Double |
getVariable(java.lang.String s)
gets the variable's value that was assigned previously |
void |
reset()
resets the evaluator |
void |
setExpression(java.lang.String s)
sets the expression |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static ConstExprEvaluator.Operator[] operators
Constructor Detail |
public ConstExprEvaluator()
public ConstExprEvaluator(java.lang.String s)
Method Detail |
public void setExpression(java.lang.String s)
public void reset()
public java.lang.Double getValue()
public java.lang.Double getVariable(java.lang.String s)
protected ConstExprEvaluator.Operator[] getOperators()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |