gnu.kawa.reflect

Class ClassMethods

Implemented Interfaces:
Named

public class ClassMethods
extends Procedure2

Field Summary

static ClassMethods
classMethods

Method Summary

static MethodProc
apply(ClassType dtype, String mname, Type rtype, Type[] atypes, int modifiers, int modmask)
static MethodProc
apply(Procedure thisProc, Object arg0, Object arg1, Type rtype, Type[] atypes, int modifiers, int modmask)
Object
apply2(Object arg0, Object arg1)
Create a method or generic of the matching methods.
static PrimProcedure[]
getMethods(ClassType dtype, String mname, int modifiers, int modmask, boolean is_special, ClassType caller, Language language)
Return the methods of a class with the specified name and flag.
static PrimProcedure[]
getMethods(ClassType dtype, String mname, int modifiers, int modmask, 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, apply2, apply3, apply4, applyN, numArgs

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Field Details

classMethods

public static final ClassMethods classMethods

Method Details

apply

public static MethodProc apply(ClassType dtype,
                               String mname,
                               Type rtype,
                               Type[] atypes,
                               int modifiers,
                               int modmask)

apply

public static MethodProc apply(Procedure thisProc,
                               Object arg0,
                               Object arg1,
                               Type rtype,
                               Type[] atypes,
                               int modifiers,
                               int modmask)

apply2

public Object apply2(Object arg0,
                     Object arg1)
Create a method or generic of the matching methods.
Overrides:
apply2 in interface 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 ClassMethodProc.make(arg0, arg1), but with some extar conversions and checks.

getMethods

public static PrimProcedure[] getMethods(ClassType dtype,
                                         String mname,
                                         int modifiers,
                                         int modmask,
                                         boolean is_special,
                                         ClassType caller,
                                         Language language)
Return the methods of a class with the specified name and flag.
Returns:
an array containing the methods.

getMethods

public static PrimProcedure[] getMethods(ClassType dtype,
                                         String mname,
                                         int modifiers,
                                         int modmask,
                                         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.