public interface Calculable
ExpressionBuilder
Modifier and Type | Method and Description |
---|---|
double |
calculate()
calculate the result of the expression
|
double |
calculate(double... variableValues)
calculate the result of the expression
|
java.lang.String |
getExpression()
return the expression in reverse polish postfix notation
|
void |
setVariable(java.lang.String name,
double value)
set a variable value for the calculation
|
double calculate()
double calculate(double... variableValues)
variableValues
- the values of the variable. The values must be in the same order as the declaration of variables in
the ExpressionBuilder
used to construct this Calculable
instancejava.lang.String getExpression()
Calculable
void setVariable(java.lang.String name, double value)
name
- the variable namevalue
- the value of the variable