All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.ArrayAllocationExpression

java.lang.Object
   |
   +----openjava.ptree.PtreeObject
           |
           +----openjava.ptree.NonLeaf
                   |
                   +----openjava.ptree.ArrayAllocationExpression

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.

See Also:
Expression, TypeName, DimExprList, ArrayInitializer

Constructor Index

 o ArrayAllocationExpression(TypeName, DimExprList)
Allocates a new ptree object.
 o ArrayAllocationExpression(TypeName, DimExprList, ArrayInitializer)
Allocates a new ptree object.

Method Index

 o getDimExprList()
Gets the dimexpr list of the array.
 o getInitializer()
Gets the initializer of this array allocation.
 o getTypeName()
Gets the type name of the array.
 o setDimExprList(DimExprList)
Sets the dimexpr list of the array.
 o setInitializer(ArrayInitializer)
Sets the initializer of this array allocation.
 o setTypeName(TypeName)
Sets the type name of the array.
 o writeCode()
Writes the code this parse-tree presents for.

Constructors

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

Parameters:
typename - the type name.
dimlist - the dimension expression list.
 o ArrayAllocationExpression
 public ArrayAllocationExpression(TypeName typename,
                                  DimExprList dimlist,
                                  ArrayInitializer ainit)
Allocates a new ptree object.

Parameters:
typename - the type name.
dimlist - the dimension expression list.
ainit - the array initializer. If this is null, no initializer will be provided this allocation with.

Methods

 o writeCode
 public void writeCode()
Writes the code this parse-tree presents for.

Overrides:
writeCode in class NonLeaf
 o getTypeName
 public TypeName getTypeName()
Gets the type name of the array.

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

Parameters:
typename - the type name of the array.
 o getDimExprList
 public DimExprList getDimExprList()
Gets the dimexpr list of the array.

Returns:
the dimexpr list of the array.
 o setDimExprList
 public void setDimExprList(DimExprList dimlist)
Sets the dimexpr list of the array.

Parameters:
dimlist - the dimexpr list of the array.
 o getInitializer
 public ArrayInitializer getInitializer()
Gets the initializer of this array allocation.

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

Parameters:
ainit - the initializer. If this is null, no initializer will be set.

All Packages  Class Hierarchy  This Package  Previous  Next  Index