Package gnu.expr
Class GenericProc
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.ProcedureN
gnu.mapping.MethodProc
gnu.expr.GenericProc
- All Implemented Interfaces:
Named
A collection of MethodProcs; one is chosen at apply time.
-
Field Summary
FieldsFields inherited from class gnu.mapping.MethodProc
applyToConsumerDefaultMP, argTypes, NO_MATCH, NO_MATCH_AMBIGUOUS, NO_MATCH_BAD_TYPE, NO_MATCH_GUARD_FALSE, NO_MATCH_TOO_FEW_ARGS, NO_MATCH_TOO_MANY_ARGS, NO_MATCH_UNUSED_KEYWORD, THROW_ON_EXCEPTIONFields inherited from class gnu.mapping.ProcedureN
applyToObject, noArgsFields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKeyFields inherited from class gnu.mapping.PropertySet
nameKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MethodProc method) protected voidaddAll(MethodProc[] procs) voidaddAtEnd(MethodProc method) static ObjectapplyToConsumerGP(Procedure proc, CallContext ctx) getMethod(int i) intintisApplicable(Type[] args, Type restType) Test if method is applicable to an invocation with given arguments.static GenericProcCreate a GenericProc from one or more methods, plus properties.static GenericProcmakeWithoutSorting(Object... args) intnumArgs()ReturnminArgs()|(maxArgs<<12).final voidsetProperties(Object[] args) voidsetProperty(Keyword key, Object value) Methods inherited from class gnu.mapping.MethodProc
applyToConsumerDefaultMP, getParameterType, matchFailAsException, mostSpecific, numParameters, overrideEquivalent, resolveParameterTypesMethods inherited from class gnu.mapping.ProcedureN
applyToObjectMethods inherited from class gnu.mapping.Procedure
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toStringMethods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
Field Details
-
methods
-
applyToConsumerGP
-
-
Constructor Details
-
GenericProc
-
GenericProc
public GenericProc()
-
-
Method Details
-
getMethodCount
public int getMethodCount() -
getMethod
-
numArgs
public int numArgs()Description copied from class:ProcedureReturnminArgs()|(maxArgs<<12). We use a single virtual function to reduce the number of methods in the system, as well as the number of virtual method table entries. We shift by 12 so the number can normally be represented using a sipush instruction, without requiring a constant pool entry. -
addAll
-
addAtEnd
-
add
-
isApplicable
Description copied from class:MethodProcTest if method is applicable to an invocation with given arguments.- Overrides:
isApplicablein classMethodProc- Parameters:
args- array of known "single" arguments.restType- If null, the arguments are fully specified by argTypes. If non-null, there may be an unknown number of extra arguments of the given restType. This is used for splices, where we usually don't know at compile-time how many argument values we have.- Returns:
- -1 if no; 1 if yes; 0 if need to check at run-time.
-
applyToConsumerGP
- Throws:
Throwable
-
setProperty
-
setProperties
-
make
Create a GenericProc from one or more methods, plus properties. -
makeWithoutSorting
-