koala.dynamicjava.tree
Class CastExpression

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Expression
          extended by koala.dynamicjava.tree.UnaryExpression
              extended by koala.dynamicjava.tree.CastExpression
All Implemented Interfaces:
ExpressionContainer, SourceInfo.Wrapper

public class CastExpression
extends UnaryExpression

This class represents the cast expression nodes of the syntax tree

Version:
1.0 - 1999/04/25
Author:
Stephane Hillion

Field Summary
static java.lang.String TARGET_TYPE
           
 
Fields inherited from interface koala.dynamicjava.tree.ExpressionContainer
EXPRESSION
 
Constructor Summary
CastExpression(TypeName tt, Expression exp)
          Initializes the expression
CastExpression(TypeName tt, Expression exp, SourceInfo si)
          Initializes the expression
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 TypeName getTargetType()
          Returns the target type
 void setTargetType(TypeName t)
          Sets the target type
 java.lang.String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.UnaryExpression
getExpression, setExpression
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TARGET_TYPE

public static final java.lang.String TARGET_TYPE
See Also:
Constant Field Values
Constructor Detail

CastExpression

public CastExpression(TypeName tt,
                      Expression exp)
Initializes the expression

Parameters:
tt - the target type
exp - the casted expression
Throws:
java.lang.IllegalArgumentException - if tt is null or exp is null

CastExpression

public CastExpression(TypeName tt,
                      Expression exp,
                      SourceInfo si)
Initializes the expression

Parameters:
tt - the target type
exp - the casted expression
Throws:
java.lang.IllegalArgumentException - if tt is null or exp is null
Method Detail

getTargetType

public TypeName getTargetType()
Returns the target type


setTargetType

public void setTargetType(TypeName t)
Sets the target type

Throws:
java.lang.IllegalArgumentException - if t is null

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

public java.lang.String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class UnaryExpression