public class UnaryExpression extends Expression
| Constructor and Description |
|---|
UnaryExpression(UnaryOperator op,
Expression expr)
Constructs a unary expression with the specified operator and expression.
|
| Modifier and Type | Method and Description |
|---|---|
UnaryExpression |
clone()
Returns a clone of the unary expression.
|
static void |
defaultPrint(UnaryExpression e,
java.io.PrintWriter o)
Prints a unary expression to a stream.
|
boolean |
equals(java.lang.Object o)
Compares the unary expression with the specified object for equality.
|
Expression |
getExpression()
Returns the operand expression.
|
UnaryOperator |
getOperator()
Returns the operator of the expression.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setExpression(Expression expr)
Sets the operand expression with the specified new expression.
|
java.lang.String |
toString()
Returns a string representation of the unary expression.
|
compareTo, findExpression, getChildren, getParent, getStatement, hashCode, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verifypublic UnaryExpression(UnaryOperator op, Expression expr)
op - the unary operator.expr - the operand expression.NotAnOrphanException - if expr has a parent.public UnaryExpression clone()
clone in class Expressionpublic static void defaultPrint(UnaryExpression e, java.io.PrintWriter o)
e - The expression to print.o - The writer on which to print the expression.public java.lang.String toString()
defaultPrint(cetus.hir.UnaryExpression, java.io.PrintWriter).toString in class Expressionpublic boolean equals(java.lang.Object o)
equals in class Expressiono - the object to be compared with.o!=null, this.getClass()==o.getClass(),
and this.children.equals(o.children) ||
this.children==o.children==nullpublic Expression getExpression()
public UnaryOperator getOperator()
public static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setExpression(Expression expr)
expr - the new operand expression.NotAnOrphanException - if expr has a parent.