koala.dynamicjava.tree
Class ArrayInitializer

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

public class ArrayInitializer
extends Expression

This class represents the array initializer nodes of the syntax tree

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

Constructor Summary
ArrayInitializer(List<? extends Expression> cells)
          Initializes the expression
ArrayInitializer(List<? extends Expression> cells, SourceInfo si)
          Initializes the expression
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 List<Expression> getCells()
          Returns the list of cell initialization expressions
 TypeName getElementType()
          Returns the element type, or null if it's not set
 void setCells(List<? extends Expression> l)
          Sets the list of cell initialization expressions
 void setElementType(TypeName t)
          Sets the element type.
 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

ArrayInitializer

public ArrayInitializer(List<? extends Expression> cells)
Initializes the expression

Parameters:
cells - the list of initialized cells
Throws:
IllegalArgumentException - if cells is null

ArrayInitializer

public ArrayInitializer(List<? extends Expression> cells,
                        SourceInfo si)
Initializes the expression

Parameters:
cells - the list of initialized cells
Throws:
IllegalArgumentException - if cells is null
Method Detail

getCells

public List<Expression> getCells()
Returns the list of cell initialization expressions


setCells

public void setCells(List<? extends Expression> l)
Sets the list of cell initialization expressions

Throws:
IllegalArgumentException - if l is null

getElementType

public TypeName getElementType()
Returns the element type, or null if it's not set


setElementType

public void setElementType(TypeName t)
Sets the element type. Also recursively sets the element type of any cells that are ArrayInitializers.

Throws:
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 String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class Object