org.teatrove.tea.parsetree
Class CompareExpression
java.lang.Object
org.teatrove.tea.parsetree.Node
org.teatrove.tea.parsetree.Expression
org.teatrove.tea.parsetree.BinaryExpression
org.teatrove.tea.parsetree.CompareExpression
- All Implemented Interfaces:
- Serializable, Cloneable
public class CompareExpression
- extends BinaryExpression
A CompareExpression is otherwise known as a spaceship operation or compare
operation and contains a left expression and a right expression to which
a comparison is done between the two returning -1 if less then, 0 if equal,
or 1 if greater than.
- Author:
- Nick Hagan
- See Also:
- Serialized Form
|
Method Summary |
Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following:
return visitor.visit(this). |
boolean |
isExceptionPossible()
Returns true if an exception can be thrown while executing this
Expression. |
CompareExpression
public CompareExpression(SourceInfo info,
Token operator,
Expression left,
Expression right)
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 BinaryExpression
accept
public 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
- Parameters:
visitor - A visitor of this Node
- Returns:
- Node The Node returned by the visitor
- See Also:
NodeVisitor
Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.