|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag,
debugLevel,
LN,
out,
writerStack |
Constructor Summary | |
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,
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,
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 |
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)
Method Detail |
public void writeCode()
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 java.lang.Exception
public void accept(ParseTreeVisitor v) throws ParseTreeException
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.
visitor
- a visitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |