org.teatrove.tea.parsetree
Class NegateExpression

java.lang.Object
  extended by org.teatrove.tea.parsetree.Node
      extended by org.teatrove.tea.parsetree.Expression
          extended by org.teatrove.tea.parsetree.NegateExpression
All Implemented Interfaces:
Serializable, Cloneable

public class NegateExpression
extends Expression

NegateExpression is a simple unary expression that calculates the negative value of an expression. The expression it operates on must return a Number type.

Author:
Brian S O'Neill
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.teatrove.tea.parsetree.Expression
Expression.Conversion
 
Constructor Summary
NegateExpression(SourceInfo info, Expression expr)
           
 
Method Summary
 Object accept(NodeVisitor visitor)
          Every subclass of Node must override this method with the following: return visitor.visit(this).
 Object clone()
          Returns a clone of this Node and all its children.
 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 org.teatrove.tea.parsetree.Expression
convertTo, convertTo, forceConversion, getConversionChain, getInitialType, getType, getValue, isValueKnown, setInitialType
 
Methods inherited from class org.teatrove.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NegateExpression

public NegateExpression(SourceInfo info,
                        Expression expr)
Method Detail

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

clone

public 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

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)


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.