public class MethodReference extends JavaNonTerminalProgramElement implements MethodOrConstructorReference, MemberReference, ReferencePrefix, ReferenceSuffix, ExpressionStatement, TypeReferenceContainer, NameReference
Modifier and Type | Field and Description |
---|---|
protected ImmutableArray<? extends Expression> |
arguments
Arguments.
|
protected MethodName |
name
Name.
|
protected ReferencePrefix |
prefix
Access path.
|
Constructor and Description |
---|
MethodReference(ExtList children,
MethodName n,
ReferencePrefix p) |
MethodReference(ExtList args,
MethodName n,
ReferencePrefix p,
PositionInfo pos) |
MethodReference(ExtList children,
MethodName n,
ReferencePrefix p,
PositionInfo pos,
java.lang.String scope) |
MethodReference(ImmutableArray<? extends Expression> args,
MethodName n,
ReferencePrefix p) |
MethodReference(ImmutableArray<Expression> args,
MethodName n,
ReferencePrefix p,
PositionInfo pos) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkArguments() |
KeYJavaType |
determineStaticPrefixType(Services services,
ExecutionContext ec)
returns the static KeYJavaType of the methods prefix
|
Expression |
getArgumentAt(int index)
Gets index-th argument
|
ImmutableArray<? extends Expression> |
getArguments()
Get arguments.
|
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.
|
Expression |
getExpressionAt(int index) |
int |
getExpressionCount()
Get the number of expressions in this container.
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
SourceElement |
getFirstElementIncludingBlocks()
Finds the source element that occurs first in the source.
|
KeYJavaType |
getKeYJavaType() |
KeYJavaType |
getKeYJavaType(Services javaServ) |
KeYJavaType |
getKeYJavaType(Services services,
ExecutionContext ec)
returns the
KeYJavaType of an expression |
MethodName |
getMethodName() |
ImmutableList<KeYJavaType> |
getMethodSignature(Services services,
ExecutionContext ec)
determines the arguments types and constructs a signature of the current
method
|
java.lang.String |
getName()
Get name.
|
ProgramElementName |
getProgramElementName()
Get identifier.
|
ReferencePrefix |
getReferencePrefix()
Get reference prefix.
|
TypeReference |
getTypeReferenceAt(int index) |
int |
getTypeReferenceCount()
Get the number of type references in this container.
|
boolean |
implicit() |
IProgramMethod |
method(Services services,
KeYJavaType refPrefixType,
ExecutionContext ec) |
IProgramMethod |
method(Services services,
KeYJavaType classType,
ImmutableList<KeYJavaType> signature,
KeYJavaType context) |
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
|
compatibleBlockSize, computeHashCode, equals, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
equalsModRenaming, getEndPosition, getLastElement, getPositionInfo, getRelativePosition, getStartPosition
protected final ReferencePrefix prefix
protected final MethodName name
protected final ImmutableArray<? extends Expression> arguments
public MethodReference(ExtList args, MethodName n, ReferencePrefix p, PositionInfo pos)
public MethodReference(ImmutableArray<? extends Expression> args, MethodName n, ReferencePrefix p)
public MethodReference(ImmutableArray<Expression> args, MethodName n, ReferencePrefix p, PositionInfo pos)
public MethodReference(ExtList children, MethodName n, ReferencePrefix p)
public MethodReference(ExtList children, MethodName n, ReferencePrefix p, PositionInfo pos, java.lang.String scope)
protected void checkArguments()
public SourceElement getFirstElement()
JavaSourceElement
getFirstElement
in interface SourceElement
getFirstElement
in class JavaSourceElement
JavaSourceElement.toSource()
,
JavaSourceElement.getStartPosition()
public SourceElement getFirstElementIncludingBlocks()
SourceElement
getFirstElementIncludingBlocks
in interface SourceElement
getFirstElementIncludingBlocks
in class JavaSourceElement
SourceElement.getStartPosition()
public ReferencePrefix getReferencePrefix()
getReferencePrefix
in interface ReferencePrefix
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 int getTypeReferenceCount()
getTypeReferenceCount
in interface TypeReferenceContainer
public TypeReference getTypeReferenceAt(int index)
getTypeReferenceAt
in interface TypeReferenceContainer
public int getExpressionCount()
getExpressionCount
in interface ExpressionContainer
public Expression getExpressionAt(int index)
getExpressionAt
in interface ExpressionContainer
public final java.lang.String getName()
getName
in interface NamedModelElement
public ProgramElementName getProgramElementName()
getProgramElementName
in interface NamedProgramElement
public ImmutableArray<? extends Expression> getArguments()
getArguments
in interface MethodOrConstructorReference
public Expression getArgumentAt(int index)
public ImmutableList<KeYJavaType> getMethodSignature(Services services, ExecutionContext ec)
public KeYJavaType determineStaticPrefixType(Services services, ExecutionContext ec)
public IProgramMethod method(Services services, KeYJavaType refPrefixType, ExecutionContext ec)
public IProgramMethod method(Services services, KeYJavaType classType, ImmutableList<KeYJavaType> signature, KeYJavaType context)
services
- the Services class offering access to metamodel
informationclassType
- the KeYJavaType where to start looking for the
declared methodsignature
- the IListcontext
- the KeYJavaType from where the method is calledpublic boolean implicit()
public MethodName getMethodName()
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
p
- a pretty printer.java.io.IOException
- occasionally thrown.public KeYJavaType getKeYJavaType(Services services, ExecutionContext ec)
Expression
KeYJavaType
of an expressiongetKeYJavaType
in interface Expression
public KeYJavaType getKeYJavaType(Services javaServ)
public KeYJavaType getKeYJavaType()