public abstract class BinaryExpression extends ArithmeticInstruction
leftValue
and rightValue
which, presumably, subclasses will call.
The current version is tied to arithmetic expressions via the the return type
of leftValue
and rightValue
.
Modifier and Type | Field and Description |
---|---|
protected ArithmeticBase |
myLeft |
protected ArithmeticBase |
myRight |
protected java.lang.String |
mySymbol |
gelementsToValue
Constructor and Description |
---|
BinaryExpression(ArithmeticBase lhs,
ArithmeticBase rhs)
construct a binary expression from two subexpressions
|
Modifier and Type | Method and Description |
---|---|
double |
leftValue(Context c) |
double |
rightValue(Context c) |
java.lang.String |
toString()
Combine left/right subexpressions, return result using symbol as the
combiner/juxtaposer for the subexpressions.
|
evaluate, value
protected java.lang.String mySymbol
protected ArithmeticBase myLeft
protected ArithmeticBase myRight
public BinaryExpression(ArithmeticBase lhs, ArithmeticBase rhs)
lhs
- is the left subexpression (left-hand side)rhs
- is the right subexpression (right-hand side)public double leftValue(Context c)
public double rightValue(Context c)
public java.lang.String toString()
toString
in class java.lang.Object