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_EXCEPTION
Fields inherited from class gnu.mapping.ProcedureN
applyToObject, noArgs
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 TypeMethodDescriptionvoid
add
(MethodProc method) protected void
addAll
(MethodProc[] procs) void
addAtEnd
(MethodProc method) static Object
applyToConsumerGP
(Procedure proc, CallContext ctx) getMethod
(int i) int
int
isApplicable
(Type[] args, Type restType) Test if method is applicable to an invocation with given arguments.static GenericProc
Create a GenericProc from one or more methods, plus properties.static GenericProc
makeWithoutSorting
(Object... args) int
numArgs()
ReturnminArgs()|(maxArgs<<12)
.final void
setProperties
(Object[] args) void
setProperty
(Keyword key, Object value) Methods inherited from class gnu.mapping.MethodProc
applyToConsumerDefaultMP, getParameterType, matchFailAsException, mostSpecific, numParameters, overrideEquivalent, resolveParameterTypes
Methods inherited from class gnu.mapping.ProcedureN
applyToObject
Methods 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, toString
Methods 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:Procedure
ReturnminArgs()|(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:MethodProc
Test if method is applicable to an invocation with given arguments.- Overrides:
isApplicable
in 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
-