Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

openjava.ptree
Class ArrayAllocationExpression  view ArrayAllocationExpression download ArrayAllocationExpression.java

java.lang.Object
  extended byopenjava.ptree.ParseTreeObject
      extended byopenjava.ptree.NonLeaf
          extended byopenjava.ptree.ArrayAllocationExpression
All Implemented Interfaces:
java.lang.Cloneable, Expression, ParseTree, VariableInitializer

public class ArrayAllocationExpression
extends NonLeaf
implements Expression

The ArrayAllocationExpression class represents an expression which allocates a new array object.
This expression is like:

     new Object[2][3]
 

or:
     new String[]{ "this", "is", "a", "test" }
 

The latter is supported from JDK 1.1.


Field Summary
 
Fields inherited from class openjava.ptree.NonLeaf
 
Fields inherited from class openjava.ptree.ParseTreeObject
LN
 
Constructor Summary
(package private) ArrayAllocationExpression()
           
  ArrayAllocationExpression(openjava.mop.OJClass type, ExpressionList args)
           
  ArrayAllocationExpression(openjava.mop.OJClass type, ExpressionList args, ArrayInitializer ainit)
           
  ArrayAllocationExpression(TypeName typename, ExpressionList dimlist)
          Allocates a new ptree object.
  ArrayAllocationExpression(TypeName typename, ExpressionList dimlist, ArrayInitializer ainit)
          Allocates a new ptree object.
 
Method Summary
 void accept(openjava.ptree.util.ParseTreeVisitor v)
          Accepts a ParseTreeVisitor object as the role of a Visitor in the Visitor pattern, as the role of an Element in the Visitor pattern.
 ExpressionList getDimExprList()
          Gets the dimexpr list of the array.
 ArrayInitializer getInitializer()
          Gets the initializer of this array allocation.
 openjava.mop.OJClass getType(openjava.mop.Environment env)
           
 TypeName getTypeName()
          Gets the type name of the array.
 void setDimExprList(ExpressionList dimlist)
          Sets the dimexpr list of the array.
 void setInitializer(ArrayInitializer ainit)
          Sets the initializer of this array allocation.
 void setTypeName(TypeName typename)
          Sets the type name of the array.
 
Methods inherited from class openjava.ptree.NonLeaf
childrenAccept, elementAt, equals, getComment, getContents, getLength, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt
 
Methods inherited from class openjava.ptree.ParseTreeObject
clone, equal, getObjectID, getParent, hashCode, lastObjectID, makeCopy, replace, setParent, toFlattenString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface openjava.ptree.ParseTree
childrenAccept, equals, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString
 

Constructor Detail

ArrayAllocationExpression

public ArrayAllocationExpression(TypeName typename,
                                 ExpressionList dimlist)
Allocates a new ptree object.


ArrayAllocationExpression

public ArrayAllocationExpression(TypeName typename,
                                 ExpressionList dimlist,
                                 ArrayInitializer ainit)
Allocates a new ptree object.


ArrayAllocationExpression

public ArrayAllocationExpression(openjava.mop.OJClass type,
                                 ExpressionList args)

ArrayAllocationExpression

public ArrayAllocationExpression(openjava.mop.OJClass type,
                                 ExpressionList args,
                                 ArrayInitializer ainit)

ArrayAllocationExpression

ArrayAllocationExpression()
Method Detail

getTypeName

public TypeName getTypeName()
Gets the type name of the array.


setTypeName

public void setTypeName(TypeName typename)
Sets the type name of the array.


getDimExprList

public ExpressionList getDimExprList()
Gets the dimexpr list of the array.


setDimExprList

public void setDimExprList(ExpressionList dimlist)
Sets the dimexpr list of the array.


getInitializer

public ArrayInitializer getInitializer()
Gets the initializer of this array allocation.


setInitializer

public void setInitializer(ArrayInitializer ainit)
Sets the initializer of this array allocation.


getType

public openjava.mop.OJClass getType(openjava.mop.Environment env)
                             throws java.lang.Exception
Specified by:
getType in interface Expression

accept

public void accept(openjava.ptree.util.ParseTreeVisitor v)
            throws ParseTreeException
Description copied from interface: ParseTree
Accepts a ParseTreeVisitor object as the role of a Visitor in the Visitor pattern, as the role of an Element in the Visitor pattern.

This invoke an appropriate visit() method on the accepted visitor.

Specified by:
accept in interface ParseTree
Specified by:
accept in class ParseTreeObject