com.go.tea.parsetree
Class NotExpression
java.lang.Object
|
+--com.go.tea.parsetree.Node
|
+--com.go.tea.parsetree.Expression
|
+--com.go.tea.parsetree.NotExpression
- All Implemented Interfaces:
- java.lang.Cloneable, Logical, java.io.Serializable
- public class NotExpression
- extends Expression
- implements Logical
NotExpression is a simple unary expression that calculates the logical
"not" value of an expression. The expression it operates on must return a
Boolean type.
- Version:
- 22 , 9/07/00
- Author:
- Brian S O'Neill
- See Also:
- Serialized Form
|
Method Summary |
java.lang.Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following:
return visitor.visit(this). |
java.lang.Object |
clone()
Returns a clone of this Node and all its children. |
void |
convertTo(Type type,
boolean preferCast)
Applies a type conversion to this expression which is chained to all
previous conversions. |
Expression |
getExpression()
|
boolean |
isExceptionPossible()
Returns true if an exception can be thrown while executing this
Expression. |
void |
setExpression(Expression expr)
|
void |
setType(Type type)
Sets the type of this expression, clearing the conversion chain. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NotExpression
public NotExpression(SourceInfo info,
Expression expr)
accept
public java.lang.Object accept(NodeVisitor visitor)
- Description copied from class:
Node
- Every subclass of Node must override this method with the following:
return visitor.visit(this).
- Overrides:
accept in class Expression
- Following copied from class:
com.go.tea.parsetree.Node
- Parameters:
visitor - A visitor of this Node- Returns:
- Node The Node returned by the visitor
- See Also:
NodeVisitor
clone
public java.lang.Object clone()
- Description copied from class:
Node
- Returns a clone of this Node and all its children. Immutable child
objects are not necessarily cloned
- Overrides:
clone in class Expression
isExceptionPossible
public boolean isExceptionPossible()
- Description copied from class:
Expression
- Returns true if an exception can be thrown while executing this
Expression. By default, returns true only if a type conversion could
cause an exception.
- Overrides:
isExceptionPossible in class Expression
convertTo
public void convertTo(Type type,
boolean preferCast)
- Description copied from class:
Expression
- Applies a type conversion to this expression which is chained to all
previous conversions.
- Overrides:
convertTo in class Expression
- Following copied from class:
com.go.tea.parsetree.Expression
- Parameters:
toType - the type to convert to.preferCast - a hint that the conversion should be performed by a
type cast operation, by default is true.- Throws:
java.lang.IllegalArgumentException - when the conversion is illegal.
setType
public void setType(Type type)
- Description copied from class:
Expression
- Sets the type of this expression, clearing the conversion chain.
- Overrides:
setType in class Expression
getExpression
public Expression getExpression()
setExpression
public void setExpression(Expression expr)