public interface MethodInstance extends FunctionInstance, MemberInstance, Declaration
MethodInstance
represents the type information for a Java
method.Modifier and Type | Method and Description |
---|---|
boolean |
canOverride(MethodInstance mi)
Return true if this method can override
mi , false otherwise. |
boolean |
canOverrideImpl(MethodInstance mi,
boolean quiet)
Return true if this method can override
mi . |
void |
checkOverride(MethodInstance mi)
Return true if this method can override
mi , throws
a SemanticException otherwise. |
MethodInstance |
container(ReferenceType container) |
MethodInstance |
flags(Flags flags)
Non-destructive updates.
|
MethodInstance |
formalTypes(java.util.List<? extends Type> l) |
java.util.List<? extends MethodInstance> |
implemented()
Get the set of methods this method implements.
|
java.util.List<MethodInstance> |
implementedImpl(ReferenceType rt)
Get the set of methods in rt and its superinterfaces that
this method implements.
|
boolean |
isSameMethod(MethodInstance mi)
Return true if this method has the same signature as
mi . |
boolean |
isSameMethodImpl(MethodInstance mi)
Return true if this method has the same signature as
mi . |
boolean |
methodCallValid(java.lang.String name,
java.util.List<? extends Type> actualTypes)
Return true if this method can be called with name
name
and actual parameters of types actualTypes . |
boolean |
methodCallValidImpl(java.lang.String name,
java.util.List<? extends Type> actualTypes)
Return true if this method can be called with name
name
and actual parameters of types actualTypes . |
java.lang.String |
name()
The method's name.
|
MethodInstance |
name(java.lang.String name) |
MethodInstance |
orig() |
java.util.List<MethodInstance> |
overrides()
Get the list of methods this method (potentially) overrides, in order
from this class (i.e., including
this ) to super classes. |
java.util.List<MethodInstance> |
overridesImpl()
Get the list of methods this method (potentially) overrides, in order
from this class (i.e., including
this ) to super classes. |
MethodInstance |
returnType(Type returnType) |
void |
setName(java.lang.String name)
Destructively set the method's name.
|
MethodInstance |
throwTypes(java.util.List<? extends Type> l) |
returnType, setReturnType
callValid, callValidImpl, designator, formalTypes, hasFormals, hasFormalsImpl, moreSpecific, moreSpecificImpl, setFormalTypes, setThrowTypes, signature, throwsSubset, throwsSubsetImpl, throwTypes
flags
equalsImpl, isCanonical, position, typeSystem
container, flags, setContainer, setFlags
declaration, setDeclaration
java.lang.String name()
void setName(java.lang.String name)
name
- the name to setMethodInstance flags(Flags flags)
MethodInstance name(java.lang.String name)
MethodInstance returnType(Type returnType)
MethodInstance formalTypes(java.util.List<? extends Type> l)
MethodInstance throwTypes(java.util.List<? extends Type> l)
MethodInstance container(ReferenceType container)
MethodInstance orig()
java.util.List<MethodInstance> overrides()
this
) to super classes.MethodInstance
, starting with
this
. Note that this list does not include methods declared
in interfaces. Use implemented
for that.MethodInstance
boolean canOverride(MethodInstance mi)
mi
, false otherwise.void checkOverride(MethodInstance mi) throws SemanticException
mi
, throws
a SemanticException otherwise.SemanticException
java.util.List<? extends MethodInstance> implemented()
boolean isSameMethod(MethodInstance mi)
mi
.boolean methodCallValid(java.lang.String name, java.util.List<? extends Type> actualTypes)
name
and actual parameters of types actualTypes
.name
- The method to call.actualTypes
- A list of argument types of type Type
.Type
java.util.List<MethodInstance> overridesImpl()
this
) to super classes.
This method should not be called except by TypeSystem
and by subclasses.MethodInstance
, starting with
this
.MethodInstance
boolean canOverrideImpl(MethodInstance mi, boolean quiet) throws SemanticException
mi
.
This method should not be called except by TypeSystem
and by subclasses.
If quiet is true and this method cannot override mi
, then
false is returned; otherwise, if quiet is false and this method cannot
override mi
, then a SemanticException is thrown.quiet
- If true, then no Semantic Exceptions will be thrown, and the
return value will be true or false. Otherwise, if the method
cannot override, then a SemanticException will be thrown, else
the method will return true.SemanticException
java.util.List<MethodInstance> implementedImpl(ReferenceType rt)
rt
- The point in the type hierarchy to begin looking for methods.boolean isSameMethodImpl(MethodInstance mi)
mi
.
This method should not be called except by TypeSystem
and by subclasses.boolean methodCallValidImpl(java.lang.String name, java.util.List<? extends Type> actualTypes)
name
and actual parameters of types actualTypes
.
This method should not be called except by TypeSystem
and by subclasses.