public class MethodDeclaration extends JavaDeclaration implements MemberDeclaration, TypeReferenceContainer, NamedProgramElement, ParameterContainer, Method, VariableScope
| Modifier and Type | Field and Description | 
|---|---|
protected StatementBlock | 
body  | 
protected Throws | 
exceptions  | 
protected ProgramElementName | 
name  | 
protected ImmutableArray<ParameterDeclaration> | 
parameters  | 
protected boolean | 
parentIsInterfaceDeclaration
this field stores if parent is an InterfaceDeclaration because we will be
 unable to walk the tree upwards to check this 
 | 
protected TypeReference | 
returnType  | 
protected Comment[] | 
voidComments  | 
modArray| Constructor and Description | 
|---|
MethodDeclaration(ExtList children,
                 boolean parentIsInterfaceDeclaration,
                 Comment[] voidComments)
Method declaration. 
 | 
MethodDeclaration(Modifier[] modifiers,
                 TypeReference returnType,
                 ProgramElementName name,
                 ImmutableArray<ParameterDeclaration> parameters,
                 Throws exceptions,
                 StatementBlock body,
                 boolean parentIsInterfaceDeclaration)
Method declaration. 
 | 
MethodDeclaration(Modifier[] modifiers,
                 TypeReference returnType,
                 ProgramElementName name,
                 ParameterDeclaration[] parameters,
                 Throws exceptions,
                 StatementBlock body,
                 boolean parentIsInterfaceDeclaration)
Method declaration. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
StatementBlock | 
getBody()  | 
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. 
 | 
SourceElement | 
getFirstElement()
Finds the source element that occurs first in the source. 
 | 
java.lang.String | 
getFullName()
Returns the maximal expanded name including all applicable
       qualifiers. 
 | 
SourceElement | 
getLastElement()
Finds the source element that occurs last in the source. 
 | 
java.lang.String | 
getName()
Return the name of the model element. 
 | 
ParameterDeclaration | 
getParameterDeclarationAt(int index)
Return the parameter declaration at the specified index in this node's
      "virtual" parameter declaration array. 
 | 
int | 
getParameterDeclarationCount()
Get the number of parameters in this container. 
 | 
ImmutableArray<ParameterDeclaration> | 
getParameters()  | 
ProgramElementName | 
getProgramElementName()
Get identifier. 
 | 
int | 
getStateCount()
Get the state count of the declaration 
 | 
Statement | 
getStatementAt(int index)  | 
int | 
getStatementCount()
Get the number of statements in this container. 
 | 
Throws | 
getThrown()  | 
TypeReference | 
getTypeReference()
Get return type. 
 | 
TypeReference | 
getTypeReferenceAt(int index)  | 
int | 
getTypeReferenceCount()
Get the number of type references in this container. 
 | 
Comment[] | 
getVoidComments()  | 
boolean | 
isAbstract()
Test whether the declaration is abstract. 
 | 
boolean | 
isFinal()
Test whether the declaration is final. 
 | 
boolean | 
isModel()
Test whether the declaration is model (the jml modifier is meant). 
 | 
boolean | 
isNative()
Test whether the declaration is native. 
 | 
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 strictfp. 
 | 
boolean | 
isSynchronized()
Test whether the declaration is synchronized. 
 | 
boolean | 
isVarArgMethod()
test whether the declaration is a method with a variable number of arguments (i.e. the ellipsis ...) 
 | 
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 
 | 
getModifiers, getVisibilityModifier, isGhost, isTransient, isVolatilecompatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetModifiersgetComments, matchequalsModRenaming, getEndPosition, getFirstElementIncludingBlocks, getPositionInfo, getRelativePosition, getStartPositionprotected final TypeReference returnType
protected final Comment[] voidComments
protected final ProgramElementName name
protected final ImmutableArray<ParameterDeclaration> parameters
protected final Throws exceptions
protected final StatementBlock body
protected final boolean parentIsInterfaceDeclaration
public MethodDeclaration(ExtList children, boolean parentIsInterfaceDeclaration, Comment[] voidComments)
children - an ExtList of children.  May
 include: a TypeReference (as a reference to the return type), a
 de.uka.ilkd.key.logic.ProgramElementName (as Name of the method),
 several ParameterDeclaration (as parameters of the declared method), a
 StatementBlock (as body of the declared method), several Modifier 
 (taken as modifiers of the declaration), a CommentparentIsInterfaceDeclaration - a boolean set true iff
 parent is an InterfaceDeclarationpublic MethodDeclaration(Modifier[] modifiers, TypeReference returnType, ProgramElementName name, ParameterDeclaration[] parameters, Throws exceptions, StatementBlock body, boolean parentIsInterfaceDeclaration)
modifiers - a modifier arrayreturnType - a type reference.name - an identifier.parameters - a parameter declaration mutable list.exceptions - a throws.body - a statement block.parentIsInterfaceDeclaration - a boolean set true iff
 parent is an InterfaceDeclarationpublic MethodDeclaration(Modifier[] modifiers, TypeReference returnType, ProgramElementName name, ImmutableArray<ParameterDeclaration> parameters, Throws exceptions, StatementBlock body, boolean parentIsInterfaceDeclaration)
modifiers - a modifier arrayreturnType - a type reference.name - an identifier.parameters - a parameter declaration mutable list.exceptions - a throws.body - a statement block.parentIsInterfaceDeclaration - a boolean set true iff
 parent is an InterfaceDeclarationpublic ProgramElementName getProgramElementName()
NamedProgramElementgetProgramElementName in interface NamedProgramElementpublic SourceElement getFirstElement()
JavaSourceElementgetFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementJavaSourceElement.toSource(), 
JavaSourceElement.getStartPosition()public SourceElement getLastElement()
JavaSourceElementgetLastElement in interface SourceElementgetLastElement in class JavaSourceElementJavaSourceElement.toSource(), 
JavaSourceElement.getEndPosition()public int getChildCount()
NonTerminalProgramElementgetChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
NonTerminalProgramElementgetChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arraypublic int getStatementCount()
StatementContainergetStatementCount in interface StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerpublic int getTypeReferenceCount()
TypeReferenceContainergetTypeReferenceCount in interface TypeReferenceContainerpublic TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt in interface TypeReferenceContainerpublic int getParameterDeclarationCount()
ParameterContainergetParameterDeclarationCount in interface ParameterContainerpublic ParameterDeclaration getParameterDeclarationAt(int index)
ParameterContainergetParameterDeclarationAt in interface ParameterContainerindex - an index for a parameter declaration.public TypeReference getTypeReference()
public Comment[] getVoidComments()
public final java.lang.String getName()
NamedModelElementgetName in interface NamedModelElementpublic ImmutableArray<ParameterDeclaration> getParameters()
public java.lang.String getFullName()
ProgramModelElementgetFullName in interface ProgramModelElementpublic Throws getThrown()
public StatementBlock getBody()
public boolean isFinal()
JavaDeclarationisFinal in interface MemberisFinal in class JavaDeclarationtrue if this member is final,
       false otherwise.public boolean isPrivate()
JavaDeclarationisPrivate in interface MemberisPrivate in interface MemberDeclarationisPrivate in class JavaDeclarationtrue if this member is private,
       false otherwise.public boolean isProtected()
JavaDeclarationisProtected in interface MemberisProtected in interface MemberDeclarationisProtected in class JavaDeclarationtrue if this member is protected,
       false otherwise.public boolean isPublic()
isPublic in interface MemberisPublic in interface MemberDeclarationisPublic in class JavaDeclarationtrue if this member is public,
       false otherwise.public boolean isStatic()
JavaDeclarationisStatic in interface MemberisStatic in interface MemberDeclarationisStatic in class JavaDeclarationtrue if this member is static,
       false otherwise.public boolean isModel()
JavaDeclarationisModel in class JavaDeclarationpublic int getStateCount()
JavaDeclarationgetStateCount in class JavaDeclarationpublic boolean isVarArgMethod()
public boolean isStrictFp()
JavaDeclarationisStrictFp in interface MemberisStrictFp in interface MemberDeclarationisStrictFp in class JavaDeclarationtrue if this member is strictfp,
       false otherwise.public boolean isAbstract()
isAbstract in interface MethodisAbstract in class JavaDeclarationtrue if this member is abstract,
       false otherwise.Constructorpublic boolean isNative()
isNative in interface MethodisNative in class JavaDeclarationtrue if this method is native,
       false otherwise.Constructorpublic boolean isSynchronized()
JavaDeclarationisSynchronized in interface MethodisSynchronized in class JavaDeclarationtrue if this method is synchronized,
       false otherwise.Constructorpublic void visit(Visitor v)
SourceElementvisit in interface SourceElementv - the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElementprettyPrint in interface SourceElementprettyPrint in class JavaProgramElementp - a pretty printer.java.io.IOException - occasionally thrown.