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