koala.dynamicjava.tree
Class InnerAllocation

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.InnerAllocation
All Implemented Interfaces:
ExpressionContainer, SourceInfo.Wrapper, StatementExpression
Direct Known Subclasses:
AnonymousInnerAllocation

public class InnerAllocation
extends PrimaryExpression
implements StatementExpression, ExpressionContainer

This class represents the *inner class* allocation nodes of the syntax tree

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

Field Summary
 
Fields inherited from interface koala.dynamicjava.tree.ExpressionContainer
EXPRESSION
 
Constructor Summary
InnerAllocation(Expression exp, Option<java.util.List<TypeName>> targs, java.lang.String cn, Option<java.util.List<TypeName>> ctargs, java.util.List<? extends Expression> args)
          Initializes the expression
InnerAllocation(Expression exp, Option<java.util.List<TypeName>> targs, java.lang.String cn, Option<java.util.List<TypeName>> ctargs, java.util.List<? extends Expression> args, SourceInfo si)
          Initializes the expression
InnerAllocation(Expression exp, java.lang.String cn, Option<java.util.List<TypeName>> ctargs, java.util.List<? extends Expression> args)
          Initializes the expression
InnerAllocation(Expression exp, java.lang.String cn, Option<java.util.List<TypeName>> ctargs, 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.
 java.lang.String getClassName()
          Returns the inner class name
 Option<java.util.List<TypeName>> getClassTypeArgs()
           
 Expression getExpression()
          Returns the outer class instance expression
 Option<java.util.List<TypeName>> getTypeArgs()
           
 void setArguments(java.util.List<? extends Expression> l)
          Sets the constructor arguments.
 void setClassName(java.lang.String cn)
          Sets the inner class name
 void setClassTypeArgs(java.util.List<TypeName> ctargs)
           
 void setClassTypeArgs(Option<java.util.List<TypeName>> ctargs)
           
 void setExpression(Expression e)
          Sets the outer class instance expression
 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

InnerAllocation

public InnerAllocation(Expression exp,
                       Option<java.util.List<TypeName>> targs,
                       java.lang.String cn,
                       Option<java.util.List<TypeName>> ctargs,
                       java.util.List<? extends Expression> args)
Initializes the expression

Parameters:
exp - the outer object
targs - the constructor's type arguments
cn - the inner class name
ctargs - the inner class's type arguments
args - the arguments of the constructor. null if no arguments.
Throws:
java.lang.IllegalArgumentException - if exp is null or tp is null

InnerAllocation

public InnerAllocation(Expression exp,
                       java.lang.String cn,
                       Option<java.util.List<TypeName>> ctargs,
                       java.util.List<? extends Expression> args)
Initializes the expression

Parameters:
exp - the outer object
cn - the inner class name
ctargs - the inner class's type arguments
args - the arguments of the constructor. null if no arguments.
Throws:
java.lang.IllegalArgumentException - if exp is null or tp is null

InnerAllocation

public InnerAllocation(Expression exp,
                       java.lang.String cn,
                       Option<java.util.List<TypeName>> ctargs,
                       java.util.List<? extends Expression> args,
                       SourceInfo si)
Initializes the expression

Parameters:
exp - the outer object
cn - the inner class name
ctargs - the inner class's type arguments
args - the arguments of the constructor. null if no arguments.
Throws:
java.lang.IllegalArgumentException - if exp is null or cn is null

InnerAllocation

public InnerAllocation(Expression exp,
                       Option<java.util.List<TypeName>> targs,
                       java.lang.String cn,
                       Option<java.util.List<TypeName>> ctargs,
                       java.util.List<? extends Expression> args,
                       SourceInfo si)
Initializes the expression

Parameters:
exp - the outer object
targs - the constructor type arguments
cn - the inner class name
ctargs - the inner class's type arguments
args - the arguments of the constructor. null if no arguments.
Throws:
java.lang.IllegalArgumentException - if exp is null or cn is null
Method Detail

getExpression

public Expression getExpression()
Returns the outer class instance expression

Specified by:
getExpression in interface ExpressionContainer

setExpression

public void setExpression(Expression e)
Sets the outer class instance expression

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

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)

getClassName

public java.lang.String getClassName()
Returns the inner class name


setClassName

public void setClassName(java.lang.String cn)
Sets the inner class name

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

getClassTypeArgs

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

setClassTypeArgs

public void setClassTypeArgs(java.util.List<TypeName> ctargs)

setClassTypeArgs

public void setClassTypeArgs(Option<java.util.List<TypeName>> ctargs)

getArguments

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

Returns:
null if there is no argument.

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