koala.dynamicjava.tree
Class InstanceOfExpression

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

public class InstanceOfExpression
extends Expression
implements ExpressionContainer

This class represents the instanceof expression nodes of the syntax tree

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

Field Summary
 
Fields inherited from interface koala.dynamicjava.tree.ExpressionContainer
EXPRESSION
 
Constructor Summary
InstanceOfExpression(Expression exp, TypeName t)
          Initializes the expression
InstanceOfExpression(Expression exp, TypeName t, SourceInfo si)
          Initializes the expression
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Expression getExpression()
          Returns the expression to check
 TypeName getReferenceType()
          Returns the type to check
 void setExpression(Expression e)
          Sets the expression to check
 void setReferenceType(TypeName t)
          Sets the type to check
 java.lang.String toString()
          Implementation of toString for use in unit testing
 
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
 

Constructor Detail

InstanceOfExpression

public InstanceOfExpression(Expression exp,
                            TypeName t)
Initializes the expression

Parameters:
exp - the expression to test
t - the type to check
Throws:
java.lang.IllegalArgumentException - if exp is null or t is null

InstanceOfExpression

public InstanceOfExpression(Expression exp,
                            TypeName t,
                            SourceInfo si)
Initializes the expression

Parameters:
exp - the expression to test
t - the type to check
Throws:
java.lang.IllegalArgumentException - if exp is null or t is null
Method Detail

getExpression

public Expression getExpression()
Returns the expression to check

Specified by:
getExpression in interface ExpressionContainer

setExpression

public void setExpression(Expression e)
Sets the expression to check

Specified by:
setExpression in interface ExpressionContainer
Throws:
java.lang.IllegalArgumentException - if e is null

getReferenceType

public TypeName getReferenceType()
Returns the type to check


setReferenceType

public void setReferenceType(TypeName t)
Sets the type to check

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 java.lang.Object