koala.dynamicjava.tree
Class SimpleAllocation

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Expression
          extended by koala.dynamicjava.tree.PrimaryExpression
              extended by koala.dynamicjava.tree.SimpleAllocation
All Implemented Interfaces:
SourceInfo.Wrapper, StatementExpression
Direct Known Subclasses:
AnonymousAllocation

public class SimpleAllocation
extends PrimaryExpression
implements StatementExpression

This class represents the regular allocation nodes of the syntax tree. Nodes are derived from syntax like "new Foo(x, y+3, z.method())"

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

Constructor Summary
SimpleAllocation(Option<java.util.List<TypeName>> targs, ReferenceTypeName tp, java.util.List<? extends Expression> args)
          Initializes the expression
SimpleAllocation(Option<java.util.List<TypeName>> targs, ReferenceTypeName tp, java.util.List<? extends Expression> args, SourceInfo si)
          Initializes the expression
SimpleAllocation(ReferenceTypeName tp, java.util.List<? extends Expression> args)
          Initializes the expression
SimpleAllocation(ReferenceTypeName tp, java.util.List<? extends Expression> args, SourceInfo si)
          Initializes the expression
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 java.util.List<Expression> getArguments()
          Returns the constructor arguments
 ReferenceTypeName getCreationType()
          Returns the creation type
 Option<java.util.List<TypeName>> getTypeArgs()
           
 void setArguments(java.util.List<? extends Expression> l)
          Sets the constructor arguments.
 void setCreationType(ReferenceTypeName t)
          Sets the creation type
 void setTypeArgs(java.util.List<TypeName> targs)
           
 void setTypeArgs(Option<java.util.List<TypeName>> targs)
           
 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

SimpleAllocation

public SimpleAllocation(Option<java.util.List<TypeName>> targs,
                        ReferenceTypeName tp,
                        java.util.List<? extends Expression> args)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor
Throws:
java.lang.IllegalArgumentException - if tp is null

SimpleAllocation

public SimpleAllocation(ReferenceTypeName tp,
                        java.util.List<? extends Expression> args)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor
Throws:
java.lang.IllegalArgumentException - if tp is null

SimpleAllocation

public SimpleAllocation(ReferenceTypeName tp,
                        java.util.List<? extends Expression> args,
                        SourceInfo si)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor
Throws:
java.lang.IllegalArgumentException - if tp is null

SimpleAllocation

public SimpleAllocation(Option<java.util.List<TypeName>> targs,
                        ReferenceTypeName tp,
                        java.util.List<? extends Expression> args,
                        SourceInfo si)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor
Throws:
java.lang.IllegalArgumentException - if tp is null
Method Detail

getTypeArgs

public Option<java.util.List<TypeName>> getTypeArgs()

setTypeArgs

public void setTypeArgs(java.util.List<TypeName> targs)

setTypeArgs

public void setTypeArgs(Option<java.util.List<TypeName>> targs)

getCreationType

public ReferenceTypeName getCreationType()
Returns the creation type


setCreationType

public void setCreationType(ReferenceTypeName t)
Sets the creation type

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

getArguments

public java.util.List<Expression> getArguments()
Returns the constructor arguments


setArguments

public void setArguments(java.util.List<? extends Expression> l)
Sets the constructor arguments.


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