public abstract class BinaryExpression extends Expression
Constructor and Description |
---|
BinaryExpression(Expression first,
Expression second)
Initializes this binary expression with the given two subexpressions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Tests whether this binary expression is the same as the given object.
|
double |
evaluate(double x,
double y,
BinaryOperator operator)
Evaluates this binary expression at the given x- and y-coordinate
with the given binary operator.
|
int |
hashCode()
Returns the hash code of this binary expression.
|
String |
toString(String pattern)
Returns a string representation of this binary expression for the given pattern.
|
evaluate
public BinaryExpression(Expression first, Expression second)
first
- the first subexpression.second
- the second subexpression.public boolean equals(Object object)
public int hashCode()
public double evaluate(double x, double y, BinaryOperator operator)
x
- the x-coordinate.y
- the y-coordinate.operator
- a binary operator.public String toString(String pattern)
pattern
- the pattern describing how the two subexpressions should be combined.