|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.ArrayAllocationExpression
The ArrayAllocationExpression
class represents
an expression which allocates a new array object.
This expression is like:
new Object[2][3]
new String[]{ "this", "is", "a", "test" }
Expression
,
TypeName
,
ExpressionList
,
ArrayInitializer
Field Summary |
Fields inherited from class openjava.ptree.NonLeaf |
|
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag, debugLevel, LN, out, writerStack |
Constructor Summary | |
(package private) |
ArrayAllocationExpression()
|
|
ArrayAllocationExpression(OJClass type,
ExpressionList args)
|
|
ArrayAllocationExpression(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(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. |
OJClass |
getType(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. |
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, childrenAreEqual, elementAt, equals, getComment, getContents, getLength, getRowType, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt |
Methods inherited from class openjava.ptree.ParseTreeObject |
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, makeCopy, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface openjava.ptree.Expression |
getRowType |
Methods inherited from interface openjava.ptree.ParseTree |
childrenAccept, eq, equals, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString |
Constructor Detail |
public ArrayAllocationExpression(TypeName typename, ExpressionList dimlist)
typename
- the type name.dimlist
- the dimension expression list.public ArrayAllocationExpression(TypeName typename, ExpressionList dimlist, ArrayInitializer ainit)
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.public ArrayAllocationExpression(OJClass type, ExpressionList args)
public ArrayAllocationExpression(OJClass type, ExpressionList args, ArrayInitializer ainit)
ArrayAllocationExpression()
Method Detail |
public void writeCode()
NonLeaf
writeCode
in interface ParseTree
writeCode
in class NonLeaf
public TypeName getTypeName()
public void setTypeName(TypeName typename)
typename
- the type name of the array.public ExpressionList getDimExprList()
public void setDimExprList(ExpressionList dimlist)
dimlist
- the dimexpr list of the array.public ArrayInitializer getInitializer()
public void setInitializer(ArrayInitializer ainit)
ainit
- the initializer.
If this is null, no initializer will be set.public OJClass getType(Environment env) throws Exception
getType
in interface Expression
Exception
public void accept(ParseTreeVisitor v) throws ParseTreeException
ParseTree
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.
accept
in interface ParseTree
accept
in class ParseTreeObject
v
- a visitor
ParseTreeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |