polyglot.ext.jl.types
Class ProcedureInstance_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeObject_c
      extended by polyglot.ext.jl.types.ProcedureInstance_c
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CodeInstance, MemberInstance, ProcedureInstance, TypeObject, Copy
Direct Known Subclasses:
ConstructorInstance_c, MethodInstance_c

public abstract class ProcedureInstance_c
extends TypeObject_c
implements ProcedureInstance

A ProcedureInstance_c contains the type information for a Java procedure (either a method or a constructor).

See Also:
Serialized Form

Field Summary
protected  ReferenceType container
           
protected  java.util.List excTypes
           
protected  Flags flags
           
protected  java.util.List formalTypes
           
 
Fields inherited from class polyglot.ext.jl.types.TypeObject_c
position, ts
 
Constructor Summary
protected ProcedureInstance_c()
          Used for deserializing types.
  ProcedureInstance_c(TypeSystem ts, Position pos, ReferenceType container, Flags flags, java.util.List formalTypes, java.util.List excTypes)
           
 
Method Summary
 boolean callValid(java.util.List argTypes)
          Returns true if a call can be made with the given argument types.
 boolean callValidImpl(java.util.List argTypes)
          Returns true if a call can be made with the given argument types.
 ReferenceType container()
          Return the member's containing type.
 boolean equalsImpl(TypeObject o)
          Default implementation is pointer equality.
 Flags flags()
          Return the member's flags.
 java.util.List formalTypes()
          List of formal parameter types.
 boolean hasFormals(java.util.List formalTypes)
          Returns true if the procedure has the given formal parameter types.
 boolean hasFormalsImpl(java.util.List formalTypes)
          Returns true if the procedure has the given formal parameter types.
 int hashCode()
           
protected  boolean listIsCanonical(java.util.List l)
           
 boolean moreSpecific(ProcedureInstance p)
          Return true if this is more specific than pi in terms of method overloading.
 boolean moreSpecificImpl(ProcedureInstance p)
          Returns whether this is more specific than p, where more specific is defined as JLS 15.12.2.2.
 boolean throwsSubset(ProcedureInstance p)
          Returns true iff this throws fewer exceptions than p.
 boolean throwsSubsetImpl(ProcedureInstance p)
          Returns true iff this throws fewer exceptions than p.
 java.util.List throwTypes()
          List of declared exception types thrown.
 
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, toString, wait, wait, wait
 
Methods inherited from interface polyglot.types.ProcedureInstance
designator, signature
 
Methods inherited from interface polyglot.types.TypeObject
isCanonical, position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 

Field Detail

container

protected ReferenceType container

flags

protected Flags flags

formalTypes

protected java.util.List formalTypes

excTypes

protected java.util.List excTypes
Constructor Detail

ProcedureInstance_c

protected ProcedureInstance_c()
Used for deserializing types.


ProcedureInstance_c

public ProcedureInstance_c(TypeSystem ts,
                           Position pos,
                           ReferenceType container,
                           Flags flags,
                           java.util.List formalTypes,
                           java.util.List excTypes)
Method Detail

container

public ReferenceType container()
Description copied from interface: MemberInstance
Return the member's containing type.

Specified by:
container in interface MemberInstance

flags

public Flags flags()
Description copied from interface: MemberInstance
Return the member's flags.

Specified by:
flags in interface MemberInstance

formalTypes

public java.util.List formalTypes()
Description copied from interface: ProcedureInstance
List of formal parameter types.

Specified by:
formalTypes in interface ProcedureInstance
Returns:
A list of Type.
See Also:
Type

throwTypes

public java.util.List throwTypes()
Description copied from interface: ProcedureInstance
List of declared exception types thrown.

Specified by:
throwTypes in interface ProcedureInstance
Returns:
A list of Type.
See Also:
Type

hashCode

public int hashCode()
Overrides:
hashCode in class TypeObject_c

equalsImpl

public boolean equalsImpl(TypeObject o)
Description copied from class: TypeObject_c
Default implementation is pointer equality.

Specified by:
equalsImpl in interface TypeObject
Overrides:
equalsImpl in class TypeObject_c
See Also:
TypeObject_c.equalsImpl(TypeObject), Object.hashCode()

listIsCanonical

protected boolean listIsCanonical(java.util.List l)

moreSpecific

public final boolean moreSpecific(ProcedureInstance p)
Description copied from interface: ProcedureInstance
Return true if this is more specific than pi in terms of method overloading.

Specified by:
moreSpecific in interface ProcedureInstance

moreSpecificImpl

public boolean moreSpecificImpl(ProcedureInstance p)
Returns whether this is more specific than p, where more specific is defined as JLS 15.12.2.2.

Note: There is a fair amount of guesswork since the JLS does not include any info regarding Java 1.2, so all inner class rules are found empirically using jikes and javac.

Specified by:
moreSpecificImpl in interface ProcedureInstance

hasFormals

public final boolean hasFormals(java.util.List formalTypes)
Returns true if the procedure has the given formal parameter types.

Specified by:
hasFormals in interface ProcedureInstance

hasFormalsImpl

public boolean hasFormalsImpl(java.util.List formalTypes)
Returns true if the procedure has the given formal parameter types.

Specified by:
hasFormalsImpl in interface ProcedureInstance

throwsSubset

public final boolean throwsSubset(ProcedureInstance p)
Returns true iff this throws fewer exceptions than p.

Specified by:
throwsSubset in interface ProcedureInstance

throwsSubsetImpl

public boolean throwsSubsetImpl(ProcedureInstance p)
Returns true iff this throws fewer exceptions than p.

Specified by:
throwsSubsetImpl in interface ProcedureInstance

callValid

public final boolean callValid(java.util.List argTypes)
Returns true if a call can be made with the given argument types.

Specified by:
callValid in interface ProcedureInstance

callValidImpl

public boolean callValidImpl(java.util.List argTypes)
Returns true if a call can be made with the given argument types.

Specified by:
callValidImpl in interface ProcedureInstance