public class FieldDeclaration extends VariableDeclaration implements MemberDeclaration
Modifier and Type | Field and Description |
---|---|
protected ImmutableArray<FieldSpecification> |
fieldSpecs
Field specs.
|
parentIsInterfaceDeclaration, typeReference
modArray
Constructor and Description |
---|
FieldDeclaration(ExtList children,
boolean parentIsInterfaceDeclaration)
Field declaration.
|
FieldDeclaration(Modifier[] mods,
TypeReference typeRef,
FieldSpecification[] vars,
boolean parentIsInterfaceDeclaration)
Field 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<FieldSpecification> |
getFieldSpecifications() |
ImmutableArray<? extends VariableSpecification> |
getVariables()
Get variables.
|
boolean |
isFinal()
Test whether the declaration is final.
|
boolean |
isGhost()
Test whether the declaration is ghost (the jml modifier is meant).
|
boolean |
isModel()
Test whether the declaration is model (the jml modifier is meant).
|
boolean |
isPrivate()
Test whether the declaration is private.
|
boolean |
isProtected()
Test whether the declaration is protected.
|
boolean |
isPublic()
Test whether the declaration is public.
|
boolean |
isStatic()
Test whether the declaration is static.
|
boolean |
isStrictFp()
Test whether the declaration is strict FP.
|
boolean |
isTransient()
Test whether the declaration is 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, parentIsInterfaceDeclaration
getModifiers, getStateCount, getVisibilityModifier, isAbstract, isNative, 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
getModifiers
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition
protected final ImmutableArray<FieldSpecification> fieldSpecs
public FieldDeclaration(Modifier[] mods, TypeReference typeRef, FieldSpecification[] vars, boolean parentIsInterfaceDeclaration)
mods
- a modifier mutable list.typeRef
- a type reference.vars
- a variable specification array.parentIsInterfaceDeclaration
- a boolean set true
iff parent is an InterfaceDeclarationpublic FieldDeclaration(ExtList children, boolean parentIsInterfaceDeclaration)
children
- an ExtList of children. May include:
several FieldSpecification (for the field)
a TypeReference (as reference to the type of the declared variable)
several Modifier (taken as modifiers of the declaration),
a CommentparentIsInterfaceDeclaration
- a boolean set truepublic ImmutableArray<FieldSpecification> getFieldSpecifications()
public ImmutableArray<? extends VariableSpecification> getVariables()
VariableDeclaration
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 isFinal()
isFinal
in class VariableDeclaration
public boolean isPrivate()
isPrivate
in interface MemberDeclaration
isPrivate
in class JavaDeclaration
public boolean isProtected()
isProtected
in interface MemberDeclaration
isProtected
in class JavaDeclaration
public boolean isPublic()
isPublic
in interface MemberDeclaration
isPublic
in class JavaDeclaration
public boolean isStatic()
JavaDeclaration
isStatic
in interface MemberDeclaration
isStatic
in class JavaDeclaration
public boolean isTransient()
isTransient
in class JavaDeclaration
public boolean isStrictFp()
isStrictFp
in interface MemberDeclaration
isStrictFp
in class JavaDeclaration
public boolean isModel()
isModel
in class JavaDeclaration
public boolean isGhost()
isGhost
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.