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
-
ArrayAllocationExpression(TypeName, DimExprList)
- Allocates a new ptree object.
-
ArrayAllocationExpression(TypeName, DimExprList, ArrayInitializer)
- Allocates a new ptree object.
-
getDimExprList()
- Gets the dimexpr list of the array.
-
getInitializer()
- Gets the initializer of this array allocation.
-
getTypeName()
- Gets the type name of the array.
-
setDimExprList(DimExprList)
- Sets the dimexpr list of the array.
-
setInitializer(ArrayInitializer)
- Sets the initializer of this array allocation.
-
setTypeName(TypeName)
- Sets the type name of the array.
-
writeCode()
- Writes the code this parse-tree presents for.
ArrayAllocationExpression
public ArrayAllocationExpression(TypeName typename,
DimExprList dimlist)
- Allocates a new ptree object.
- Parameters:
- typename - the type name.
- dimlist - the dimension expression list.
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.
writeCode
public void writeCode()
- Writes the code this parse-tree presents for.
- Overrides:
- writeCode in class NonLeaf
getTypeName
public TypeName getTypeName()
- Gets the type name of the array.
- Returns:
- the type name of the array.
setTypeName
public void setTypeName(TypeName typename)
- Sets the type name of the array.
- Parameters:
- typename - the type name of the array.
getDimExprList
public DimExprList getDimExprList()
- Gets the dimexpr list of the array.
- Returns:
- the dimexpr list of the array.
setDimExprList
public void setDimExprList(DimExprList dimlist)
- Sets the dimexpr list of the array.
- Parameters:
- dimlist - the dimexpr list of the array.
getInitializer
public ArrayInitializer getInitializer()
- Gets the initializer of this array allocation.
- Returns:
- the initializer.
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