public final class ArrayCreationExpr extends Expression implements NodeWithType<ArrayCreationExpr>, NodeWithArrays<ArrayCreationExpr>
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE| Constructor and Description |
|---|
ArrayCreationExpr() |
ArrayCreationExpr(Range range,
Type type,
int arrayCount,
ArrayInitializerExpr initializer) |
ArrayCreationExpr(Range range,
Type type,
List<Expression> dimensions,
int arrayCount) |
ArrayCreationExpr(Type type,
int arrayCount,
ArrayInitializerExpr initializer) |
ArrayCreationExpr(Type type,
List<Expression> dimensions,
int arrayCount) |
| Modifier and Type | Method and Description |
|---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
int |
getArrayCount() |
List<List<AnnotationExpr>> |
getArraysAnnotations()
Arrays annotations are annotations on the arrays modifiers of the type.
|
List<Expression> |
getDimensions() |
ArrayInitializerExpr |
getInitializer() |
Type |
getType()
Gets the type
|
ArrayCreationExpr |
setArrayCount(int arrayCount) |
ArrayCreationExpr |
setArraysAnnotations(List<List<AnnotationExpr>> arraysAnnotations)
For a description of the arrayAnnotations field refer to
NodeWithArrays.getArraysAnnotations() |
void |
setDimensions(List<Expression> dimensions) |
void |
setInitializer(ArrayInitializerExpr initializer) |
ArrayCreationExpr |
setType(Type type)
Sets the type
|
addOrphanComment, clone, contains, equals, getAllContainedComments, getBegin, getChildrenNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeOfType, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, setAsParentNodeOf, setAsParentNodeOf, setBegin, setBlockComment, setComment, setData, setEnd, setLineComment, setParentNode, setRange, toString, toStringWithoutComments, tryAddImportToParentCompilationUnitfinalize, getClass, notify, notifyAll, wait, wait, waitsetTypepublic ArrayCreationExpr()
public ArrayCreationExpr(Type type, int arrayCount, ArrayInitializerExpr initializer)
public ArrayCreationExpr(Range range, Type type, int arrayCount, ArrayInitializerExpr initializer)
public ArrayCreationExpr(Type type, List<Expression> dimensions, int arrayCount)
public ArrayCreationExpr(Range range, Type type, List<Expression> dimensions, int arrayCount)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Nodepublic <A> void accept(VoidVisitor<A> v, A arg)
Nodepublic int getArrayCount()
getArrayCount in interface NodeWithArrays<ArrayCreationExpr>public List<Expression> getDimensions()
public ArrayInitializerExpr getInitializer()
public Type getType()
NodeWithTypegetType in interface NodeWithType<ArrayCreationExpr>public ArrayCreationExpr setArrayCount(int arrayCount)
setArrayCount in interface NodeWithArrays<ArrayCreationExpr>public void setDimensions(List<Expression> dimensions)
public void setInitializer(ArrayInitializerExpr initializer)
public ArrayCreationExpr setType(Type type)
NodeWithTypesetType in interface NodeWithType<ArrayCreationExpr>type - the typepublic List<List<AnnotationExpr>> getArraysAnnotations()
NodeWithArraysArrays annotations are annotations on the arrays modifiers of the type. Consider this example:
int @Ann1 [] @Ann2 [] array;
in this this method will return a list with the annotation expressions
@Ann1and
@Ann2
Note that the first list element of arraysAnnotations will refer to the first array modifier encountered. Considering the example the first element will be a list containing just @Ann1 while the second element will be a list containing just @Ann2.
This property is guaranteed to hold:
getArraysAnnotations().size() == getArrayCount()
If a certain array modifier has no annotation the corresponding entry of arraysAnnotations will be nullgetArraysAnnotations in interface NodeWithArrays<ArrayCreationExpr>public ArrayCreationExpr setArraysAnnotations(List<List<AnnotationExpr>> arraysAnnotations)
NodeWithArraysNodeWithArrays.getArraysAnnotations()setArraysAnnotations in interface NodeWithArrays<ArrayCreationExpr>Copyright © 2007–2016. All rights reserved.