public class LocalVariableDeclaration extends VariableDeclaration implements LoopInitializer
Modifier and Type | Field and Description |
---|---|
protected ImmutableArray<VariableSpecification> |
varSpecs
Var specs.
|
parentIsInterfaceDeclaration, typeReference
modArray
Constructor and Description |
---|
LocalVariableDeclaration()
Local variable declaration.
|
LocalVariableDeclaration(ExtList children)
Local variable declaration.
|
LocalVariableDeclaration(ImmutableArray<Modifier> mods,
TypeReference typeRef,
VariableSpecification var)
Local variable declaration.
|
LocalVariableDeclaration(ImmutableArray<Modifier> mods,
TypeReference typeRef,
VariableSpecification[] vars)
Local variable declaration.
|
LocalVariableDeclaration(Modifier[] mods,
TypeReference typeRef,
VariableSpecification[] vars)
Local variable declaration.
|
LocalVariableDeclaration(TypeReference typeRef,
VariableSpecification var)
Local variable declaration which declared exactly
one variable.
|
Modifier and Type | Method and Description |
---|---|
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
child array
|
int |
getChildCount()
Returns the number of children of this node.
|
ImmutableArray<VariableSpecification> |
getVariables()
This method is identical to
getVariableSpecifications() . |
ImmutableArray<VariableSpecification> |
getVariableSpecifications()
This method is identical to
getVariables() . |
boolean |
isPrivate()
Local variables are never private.
|
boolean |
isProtected()
Local variables are never protected..
|
boolean |
isPublic()
Local variables are never "public".
|
boolean |
isStatic()
Local variables are never static.
|
boolean |
isTransient()
Local variables are never transient.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
getFirstElement, getFirstElementIncludingBlocks, getLastElement, getTypeReference, getTypeReferenceAt, getTypeReferenceCount, isFinal, parentIsInterfaceDeclaration
getModifiers, getStateCount, getVisibilityModifier, isAbstract, isGhost, isModel, isNative, isStrictFp, isSynchronized, isVolatile
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition
protected final ImmutableArray<VariableSpecification> varSpecs
public LocalVariableDeclaration()
public LocalVariableDeclaration(Modifier[] mods, TypeReference typeRef, VariableSpecification[] vars)
mods
- a modifier array.typeRef
- a type reference.vars
- a variable specification array.public LocalVariableDeclaration(TypeReference typeRef, VariableSpecification var)
typeRef
- a type reference.var
- the variable specificationpublic LocalVariableDeclaration(ImmutableArray<Modifier> mods, TypeReference typeRef, VariableSpecification var)
mods
- a modifier array.typeRef
- a type reference.var
- a variable specification .public LocalVariableDeclaration(ImmutableArray<Modifier> mods, TypeReference typeRef, VariableSpecification[] vars)
mods
- a modifier array.typeRef
- a type reference.vars
- a variable specification array.public LocalVariableDeclaration(ExtList children)
children
- an ExtList containing the children. May include:
several VariableSpecification (specifying the declared local variable),
a TypeReference (as reference to the type of the declared variable),
several Modifier (taken as modifiers of the declaration),
a Commentpublic ImmutableArray<VariableSpecification> getVariableSpecifications()
getVariables()
.public ImmutableArray<VariableSpecification> getVariables()
getVariableSpecifications()
.getVariables
in class VariableDeclaration
public int getChildCount()
getChildCount
in interface NonTerminalProgramElement
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic boolean isPrivate()
isPrivate
in class JavaDeclaration
public boolean isProtected()
isProtected
in class JavaDeclaration
public boolean isPublic()
isPublic
in class JavaDeclaration
public boolean isStatic()
isStatic
in class JavaDeclaration
public boolean isTransient()
isTransient
in class JavaDeclaration
public void visit(Visitor v)
visit
in interface SourceElement
visit
in class VariableDeclaration
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class VariableDeclaration
p
- a pretty printer.java.io.IOException
- occasionally thrown.