koala.dynamicjava.tree
Class ArrayTypeName

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.TypeName
          extended by koala.dynamicjava.tree.ArrayTypeName
All Implemented Interfaces:
SourceInfo.Wrapper

public class ArrayTypeName
extends TypeName

This class represents the array type nodes of the syntax tree

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

Constructor Summary
ArrayTypeName(TypeName et, int dim, boolean varg)
          Initializes the type
ArrayTypeName(TypeName et, int dim, boolean varg, SourceInfo si)
          Initializes the type
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 TypeName getElementType()
          Returns the type of the elements of the arrays represented by this type
 boolean isVararg()
           
 void setElementType(TypeName t)
          Sets the type of the elements of the arrays represented by this type
 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

ArrayTypeName

public ArrayTypeName(TypeName et,
                     int dim,
                     boolean varg)
Initializes the type

Parameters:
et - the element type
dim - the dimension of the arrays represented by this type (> 0)
Throws:
java.lang.IllegalArgumentException - if et is null or dim < 1

ArrayTypeName

public ArrayTypeName(TypeName et,
                     int dim,
                     boolean varg,
                     SourceInfo si)
Initializes the type

Parameters:
et - the element type
dim - the dimension of the arrays represented by this type (> 0)
Throws:
java.lang.IllegalArgumentException - if et is null or dim < 1
Method Detail

getElementType

public TypeName getElementType()
Returns the type of the elements of the arrays represented by this type


setElementType

public void setElementType(TypeName t)
Sets the type of the elements of the arrays represented by this type

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

isVararg

public boolean isVararg()

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