public class CompoundExpression extends AbstractMathExpression
Constructor and Description |
---|
CompoundExpression(AbstractMathExpression leftExp,
AbstractMathExpression rightExp,
char operator) |
Modifier and Type | Method and Description |
---|---|
double |
evaluate(java.util.Map<java.lang.String,java.lang.Double> varTable)
Determines the value of string expression represented by this class by replacing variables with values provided in map;
If expression has no variable evaluate() should be called;
|
java.lang.String |
toString()
Converts a mathematical expression an equivalent string literal
|
evaluate
public CompoundExpression(AbstractMathExpression leftExp, AbstractMathExpression rightExp, char operator)
public java.lang.String toString()
AbstractMathExpression
toString
in class AbstractMathExpression
public double evaluate(java.util.Map<java.lang.String,java.lang.Double> varTable)
AbstractMathExpression
evaluate
in class AbstractMathExpression