public class ParameterDeclaration extends VariableDeclaration
Modifier and Type | Field and Description |
---|---|
private boolean |
varArgParameter
flag to store whether this parameter is a the last arg in a method
declaration with variable number of arguments. false if not otherwise
set in the appropriate constructor.
|
protected ImmutableArray<VariableSpecification> |
varSpec
Var spec.
|
parentIsInterfaceDeclaration, typeReference
modArray
Constructor and Description |
---|
ParameterDeclaration()
Parameter declaration.
|
ParameterDeclaration(ExtList children,
boolean parentIsInterfaceDeclaration,
boolean parameterIsVarArg)
Parameter declaration.
|
ParameterDeclaration(Modifier[] mods,
TypeReference typeRef,
VariableSpecification var,
boolean parentIsInterfaceDeclaration)
Parameter declaration.
|
ParameterDeclaration(Modifier[] mods,
TypeReference typeRef,
VariableSpecification var,
boolean parentIsInterfaceDeclaration,
boolean parameterIsVarArg)
Parameter declaration.
|
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()
Get variables.
|
VariableSpecification |
getVariableSpecification() |
boolean |
isPrivate()
Parameters are never private.
|
boolean |
isProtected()
Parameters are never protected.
|
boolean |
isPublic()
Parameters are never public.
|
boolean |
isStatic()
Parameters are never static.
|
boolean |
isTransient()
Parameters are never transient.
|
boolean |
isVarArg()
returns true iff this parameter is the last in a method with
a variable number of arguments.
|
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, prettyPrint
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, getPositionInfo, getRelativePosition, getStartPosition
protected final ImmutableArray<VariableSpecification> varSpec
private final boolean varArgParameter
public ParameterDeclaration()
public ParameterDeclaration(Modifier[] mods, TypeReference typeRef, VariableSpecification var, boolean parentIsInterfaceDeclaration, boolean parameterIsVarArg)
mods
- a modifier array.typeRef
- a type reference.var
- the VariableSpecification belonging to this parameter declaration.parentIsInterfaceDeclaration
- a boolean set true iff
the parent is an InterfaceDeclarationparameterIsVarArg
- true iff this the last parameter of a method with variable number
of argumentspublic ParameterDeclaration(Modifier[] mods, TypeReference typeRef, VariableSpecification var, boolean parentIsInterfaceDeclaration)
mods
- a modifier array.typeRef
- a type reference.var
- the VariableSpecification belonging to this parameter declaration.parentIsInterfaceDeclaration
- a boolean set true iff
the parent is an InterfaceDeclarationpublic ParameterDeclaration(ExtList children, boolean parentIsInterfaceDeclaration, boolean parameterIsVarArg)
children
- an ExtList of children. May contain:
a VariableSpecification (specifying the parameter)
a TypeReference (as reference to the type of the declared variable)
several Modifier (taken as modifiers of the declaration),
a CommentparentIsInterfaceDeclaration
- a boolean set true iff
the parent is an InterfaceDeclarationparameterIsVarArg
- true iff this the last parameter of a method with variable number
of argumentspublic VariableSpecification getVariableSpecification()
public ImmutableArray<VariableSpecification> getVariables()
VariableDeclaration
getVariables
in class VariableDeclaration
public int getChildCount()
public ProgramElement getChildAt(int index)
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 boolean isVarArg()