Package gnu.kawa.reflect
Class ClassMethods
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.Procedure2
gnu.kawa.reflect.ClassMethods
- All Implemented Interfaces:
Named
-
Field Summary
FieldsFields inherited from class gnu.mapping.Procedure2
applyToObject
Fields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MethodProc
apply
(ObjectType dtype, String mname, char mode, Language language) Find methods.static MethodProc
Create a method or generic of the matching methods.static PrimProcedure[]
getMethods
(ObjectType dtype, String mname, char mode, ClassType caller, Language language) Return the methods of a class with the specified name and flag.static int
selectApplicable
(PrimProcedure[] methods, int numArgs, boolean maybeMore) Select methods that have the right number of parameters.static long
selectApplicable
(PrimProcedure[] methods, Type[] atypes, Type restType) 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, applyToObject, numArgs
Methods inherited from class gnu.mapping.Procedure
applyL, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toString
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
Field Details
-
classMethods
-
-
Constructor Details
-
ClassMethods
public ClassMethods()
-
-
Method Details
-
apply2
Create a method or generic of the matching methods.- Specified by:
apply2
in classProcedure2
- Parameters:
arg0
- a Class, ClassType, or a CharSequence or Symbol that names a class.arg1
- a method name (a CharSequence, or Symbol) Loosely the same as GetNamedPart.make(arg0, arg1), but with some extra conversions and checks.
-
apply
-
getMethods
public static PrimProcedure[] getMethods(ObjectType dtype, 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
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
.
-
selectApplicable
Select methods that have the right number of parameters.- Returns:
- number of methods that apply, NO_MATCH_TOO_FEW_ARGS, or NO_MATCH_TOO_MANY_ARGS.
-
apply
Find methods.- Parameters:
dtype
- class to searchmname
- 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).
-