gnu.kawa.reflect
Class ClassMethods

java.lang.Object
  extended by gnu.mapping.PropertySet
      extended by gnu.mapping.Procedure
          extended by gnu.mapping.Procedure2
              extended by gnu.kawa.reflect.ClassMethods
All Implemented Interfaces:
Named

public class ClassMethods
extends Procedure2


Field Summary
static ClassMethods classMethods
           
 
Constructor Summary
ClassMethods()
           
 
Method Summary
static MethodProc apply(ObjectType dtype, java.lang.String mname, char mode, Language language)
          Find methods.
static MethodProc apply(Procedure thisProc, java.lang.Object arg0, java.lang.Object arg1)
           
 java.lang.Object apply2(java.lang.Object arg0, java.lang.Object arg1)
          Create a method or generic of the matching methods.
static PrimProcedure[] getMethods(ObjectType dtype, java.lang.String mname, char mode, ClassType caller, Language language)
          Return the methods of a class with the specified name and flag.
static long selectApplicable(PrimProcedure[] methods, Type[] atypes)
          Re-order the methods such that the ones that are definite applicable (all argtypes is subset of parameter type) are first; those possibly applicable next (argtype overlaps parameter types); and ending with those definitely not applicable (some argtype does overlap its parameter type).
 
Methods inherited from class gnu.mapping.Procedure2
apply0, apply1, apply3, apply4, applyN, numArgs
 
Methods inherited from class gnu.mapping.Procedure
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toString
 
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classMethods

public static final ClassMethods classMethods
Constructor Detail

ClassMethods

public ClassMethods()
Method Detail

apply2

public java.lang.Object apply2(java.lang.Object arg0,
                               java.lang.Object arg1)
Create a method or generic of the matching methods.

Specified by:
apply2 in class Procedure2
Parameters:
arg0 - a Class, ClassType, or a String, FString or Symbol that names a class.
arg1 - a method name (a String, FString, or Symbol) Loosely the same as GetNamedPart.make(arg0, arg1), but with some extra conversions and checks.

apply

public static MethodProc apply(Procedure thisProc,
                               java.lang.Object arg0,
                               java.lang.Object arg1)

getMethods

public static PrimProcedure[] getMethods(ObjectType dtype,
                                         java.lang.String mname,
                                         char mode,
                                         ClassType caller,
                                         Language language)
Return the methods of a class with the specified name and flag.

Parameters:
caller - if non-null, check that methods are accessible in it.
Returns:
an array containing the methods.

selectApplicable

public static long selectApplicable(PrimProcedure[] methods,
                                    Type[] atypes)
Re-order the methods such that the ones that are definite applicable (all argtypes is subset of parameter type) are first; those possibly applicable next (argtype overlaps parameter types); and ending with those definitely not applicable (some argtype does overlap its parameter type).

Returns:
((number of definitely applicable methods) << 32 + (number of possibly applicable methods.

apply

public static MethodProc apply(ObjectType dtype,
                               java.lang.String mname,
                               char mode,
                               Language language)
Find methods.

Parameters:
dtype - class to search
mname - method name (already mangled, if need be).
mode - one of 'P' (use invokespecial). 'V' (require this argument even if method is static), or '\0' (otherwise).