|
||||||||||
| 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
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)
Return true iff this type object is the same as t. |
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 MethodInstancepublic java.lang.String name()
MethodInstance
name in interface MethodInstancepublic MethodInstance name(java.lang.String name)
MethodInstance
name in interface MethodInstancepublic Type returnType()
MethodInstance
returnType in interface MethodInstancepublic MethodInstance returnType(Type returnType)
MethodInstance
returnType in interface MethodInstancepublic MethodInstance formalTypes(java.util.List l)
MethodInstance
formalTypes in interface MethodInstancel - A list of Type.Typepublic MethodInstance throwTypes(java.util.List l)
MethodInstance
throwTypes in interface MethodInstancel - A list of Type.Typepublic MethodInstance container(ReferenceType container)
MethodInstance
container in interface MethodInstancepublic int hashCode()
hashCode in class ProcedureInstance_cpublic boolean equalsImpl(TypeObject o)
TypeObjectt.
All Polyglot extensions should attempt to maintain pointer
equality between TypeObjects. If this cannot be done,
extensions can override TypeObject_c.equalsImpl(), and
don't forget to override hashCode().
equalsImpl in interface TypeObjectequalsImpl in class ProcedureInstance_cpublic java.lang.String toString()
public java.lang.String signature()
ProcedureInstance
signature in interface ProcedureInstancepublic java.lang.String designator()
ProcedureInstance
designator in interface ProcedureInstancepublic final boolean isSameMethod(MethodInstance m)
isSameMethod in interface MethodInstancepublic boolean isSameMethodImpl(MethodInstance m)
isSameMethodImpl in interface MethodInstancepublic boolean isCanonical()
TypeObject
isCanonical in interface TypeObject
public final boolean methodCallValid(java.lang.String name,
java.util.List argTypes)
MethodInstancename
and actual parameters of types actualTypes.
methodCallValid in interface MethodInstancename - 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)
MethodInstancename
and actual parameters of types actualTypes.
This method should not be called except by TypeSystem
and by subclasses.
methodCallValidImpl in interface MethodInstancepublic java.util.List overrides()
MethodInstancethis) to super classes.
overrides in interface MethodInstanceMethodInstance, starting with
this. Note that this list does not include methods declared
in interfaces. Use implemented for that.MethodInstancepublic java.util.List overridesImpl()
MethodInstancethis) to super classes.
This method should not be called except by TypeSystem
and by subclasses.
overridesImpl in interface MethodInstanceMethodInstance, starting with
this.MethodInstancepublic final boolean canOverride(MethodInstance mj)
MethodInstancemi, false otherwise.
canOverride in interface MethodInstance
public final void checkOverride(MethodInstance mj)
throws SemanticException
MethodInstancemi, throws
a SemanticException otherwise.
checkOverride in interface MethodInstanceSemanticException
public final boolean canOverrideImpl(MethodInstance mj)
throws SemanticException
SemanticException
public boolean canOverrideImpl(MethodInstance mj,
boolean quiet)
throws SemanticException
MethodInstancemi.
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 MethodInstancequiet - 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.
SemanticExceptionpublic java.util.List implemented()
MethodInstance
implemented in interface MethodInstancepublic java.util.List implementedImpl(ReferenceType rt)
MethodInstance
implementedImpl in interface MethodInstancert - 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 | |||||||||