|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.ext.jl.types.TypeObject_c
polyglot.ext.jl.types.ProcedureInstance_c
polyglot.ext.jl.types.MethodInstance_c
public class MethodInstance_c
A MethodInstance
represents the type information for a Java
method.
Field Summary | |
---|---|
protected java.lang.String |
name
|
protected Type |
returnType
|
Fields inherited from class polyglot.ext.jl.types.ProcedureInstance_c |
---|
container, excTypes, flags, formalTypes |
Fields inherited from class polyglot.ext.jl.types.TypeObject_c |
---|
position, ts |
Constructor Summary | |
---|---|
protected |
MethodInstance_c()
Used for deserializing types. |
|
MethodInstance_c(TypeSystem ts,
Position pos,
ReferenceType container,
Flags flags,
Type returnType,
java.lang.String name,
java.util.List formalTypes,
java.util.List excTypes)
|
Method Summary | |
---|---|
boolean |
canOverride(MethodInstance mj)
Return true if this method can override mi , false otherwise. |
boolean |
canOverrideImpl(MethodInstance mj)
Leave this method in for historic reasons, to make sure that extensions modify their code correctly. |
boolean |
canOverrideImpl(MethodInstance mj,
boolean quiet)
Return true if this method can override mi . |
void |
checkOverride(MethodInstance mj)
Return true if this method can override mi , throws
a SemanticException otherwise. |
MethodInstance |
container(ReferenceType container)
Set the method's containing type. |
java.lang.String |
designator()
Returns either "method" or "constructor". |
boolean |
equalsImpl(TypeObject o)
Default implementation is pointer equality. |
MethodInstance |
flags(Flags flags)
Set the method's flags. |
MethodInstance |
formalTypes(java.util.List l)
Set the method's formal parameter types. |
int |
hashCode()
|
java.util.List |
implemented()
Get the set of methods this method implements. |
java.util.List |
implementedImpl(ReferenceType rt)
Get the set of methods in rt and its superinterfaces that this method implements. |
boolean |
isCanonical()
Return true if the type object contains no unknown/ambiguous types. |
boolean |
isSameMethod(MethodInstance m)
Returns true iff |
boolean |
isSameMethodImpl(MethodInstance m)
Returns true iff |
boolean |
methodCallValid(java.lang.String name,
java.util.List argTypes)
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 argTypes)
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)
Set the method's name. |
java.util.List |
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 |
overridesImpl()
Get the list of methods this method (potentially) overrides, in order from this class (i.e., including this ) to super classes. |
Type |
returnType()
The method's return type. |
MethodInstance |
returnType(Type returnType)
Set the method's return type. |
java.lang.String |
signature()
Returns a String representing the signature of the procedure. |
MethodInstance |
throwTypes(java.util.List l)
Set the method's exception throw types. |
java.lang.String |
toString()
|
Methods inherited from class polyglot.ext.jl.types.ProcedureInstance_c |
---|
callValid, callValidImpl, container, flags, formalTypes, hasFormals, hasFormalsImpl, listIsCanonical, moreSpecific, moreSpecificImpl, throwsSubset, throwsSubsetImpl, throwTypes |
Methods inherited from class polyglot.ext.jl.types.TypeObject_c |
---|
copy, equals, position, typeSystem |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.types.ProcedureInstance |
---|
callValid, callValidImpl, formalTypes, hasFormals, hasFormalsImpl, moreSpecific, moreSpecificImpl, throwsSubset, throwsSubsetImpl, throwTypes |
Methods inherited from interface polyglot.types.MemberInstance |
---|
container, flags |
Methods inherited from interface polyglot.types.TypeObject |
---|
position, typeSystem |
Methods inherited from interface polyglot.util.Copy |
---|
copy |
Field Detail |
---|
protected java.lang.String name
protected Type returnType
Constructor Detail |
---|
protected MethodInstance_c()
public MethodInstance_c(TypeSystem ts, Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List formalTypes, java.util.List excTypes)
Method Detail |
---|
public MethodInstance flags(Flags flags)
MethodInstance
flags
in interface MethodInstance
public java.lang.String name()
MethodInstance
name
in interface MethodInstance
public MethodInstance name(java.lang.String name)
MethodInstance
name
in interface MethodInstance
public Type returnType()
MethodInstance
returnType
in interface MethodInstance
public MethodInstance returnType(Type returnType)
MethodInstance
returnType
in interface MethodInstance
public MethodInstance formalTypes(java.util.List l)
MethodInstance
formalTypes
in interface MethodInstance
l
- A list of Type
.Type
public MethodInstance throwTypes(java.util.List l)
MethodInstance
throwTypes
in interface MethodInstance
l
- A list of Type
.Type
public MethodInstance container(ReferenceType container)
MethodInstance
container
in interface MethodInstance
public int hashCode()
hashCode
in class ProcedureInstance_c
public boolean equalsImpl(TypeObject o)
TypeObject_c
equalsImpl
in interface TypeObject
equalsImpl
in class ProcedureInstance_c
TypeObject_c.equalsImpl(TypeObject)
,
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String signature()
ProcedureInstance
signature
in interface ProcedureInstance
public java.lang.String designator()
ProcedureInstance
designator
in interface ProcedureInstance
public final boolean isSameMethod(MethodInstance m)
isSameMethod
in interface MethodInstance
public boolean isSameMethodImpl(MethodInstance m)
isSameMethodImpl
in interface MethodInstance
public boolean isCanonical()
TypeObject
isCanonical
in interface TypeObject
public final boolean methodCallValid(java.lang.String name, java.util.List argTypes)
MethodInstance
name
and actual parameters of types actualTypes
.
methodCallValid
in interface MethodInstance
name
- The method to call.argTypes
- A list of argument types of type Type
.Type
public boolean methodCallValidImpl(java.lang.String name, java.util.List argTypes)
MethodInstance
name
and actual parameters of types actualTypes
.
This method should not be called except by TypeSystem
and by subclasses.
methodCallValidImpl
in interface MethodInstance
public java.util.List overrides()
MethodInstance
this
) to super classes.
overrides
in interface MethodInstance
MethodInstance
, starting with
this
. Note that this list does not include methods declared
in interfaces. Use implemented
for that.MethodInstance
public java.util.List overridesImpl()
MethodInstance
this
) to super classes.
This method should not be called except by TypeSystem
and by subclasses.
overridesImpl
in interface MethodInstance
MethodInstance
, starting with
this
.MethodInstance
public final boolean canOverride(MethodInstance mj)
MethodInstance
mi
, false otherwise.
canOverride
in interface MethodInstance
public final void checkOverride(MethodInstance mj) throws SemanticException
MethodInstance
mi
, throws
a SemanticException otherwise.
checkOverride
in interface MethodInstance
SemanticException
public final boolean canOverrideImpl(MethodInstance mj) throws SemanticException
SemanticException
public boolean canOverrideImpl(MethodInstance mj, boolean quiet) throws SemanticException
MethodInstance
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.
canOverrideImpl
in interface MethodInstance
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
public java.util.List implemented()
MethodInstance
implemented
in interface MethodInstance
public java.util.List implementedImpl(ReferenceType rt)
MethodInstance
implementedImpl
in interface MethodInstance
rt
- The point in the type hierarchy to begin looking for methods.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |