- java.lang.Object
-
- com.ibm.j9ddr.tools.ddrinteractive.ExpressionEvaluator
-
public class ExpressionEvaluator extends Object
-
-
Constructor Summary
Constructors Constructor Description ExpressionEvaluator(String s)
ExpressionEvaluator(String[] as)
ExpressionEvaluator(ArrayList<String> al)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
calculate(int defaultRadix)
static long
eval(String exp)
Evaluate expression with support for operator precedence and associativitystatic long
eval(String exp, int defaultRadix)
-
-
-
Method Detail
-
eval
public static long eval(String exp) throws ExpressionEvaluatorException
Evaluate expression with support for operator precedence and associativity- Parameters:
exp
- arithmetic expression.- Returns:
- result or evaluation
- Throws:
ExpressionEvaluatorException
- if expression is in invalid format.
-
eval
public static long eval(String exp, int defaultRadix) throws ExpressionEvaluatorException
- Throws:
ExpressionEvaluatorException
-
calculate
public long calculate(int defaultRadix) throws ExpressionEvaluatorException
- Throws:
ExpressionEvaluatorException
-
-