public abstract class MethodProc extends ProcedureN
Modifier and Type | Field and Description |
---|---|
static java.lang.invoke.MethodHandle |
applyToConsumerDefaultMP |
protected java.lang.Object |
argTypes
The parameter types.
|
static int |
NO_MATCH
Return code from match: Unspecified failure.
|
static int |
NO_MATCH_AMBIGUOUS
Return code from match: Ambigious which method to select.
|
static int |
NO_MATCH_BAD_TYPE
Return code from match: Invalid argument type.
|
static int |
NO_MATCH_GUARD_FALSE |
static int |
NO_MATCH_TOO_FEW_ARGS
Return code from match: Too few actual arguments.
|
static int |
NO_MATCH_TOO_MANY_ARGS
Return code from match: Too many actual arguments.
|
static int |
NO_MATCH_UNUSED_KEYWORD
Return code from match: Unused keyword argument.
|
static int |
THROW_ON_EXCEPTION |
applyToObject, noArgs
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
nameKey
Constructor and Description |
---|
MethodProc() |
MethodProc(boolean resultGoesToConsumer,
java.lang.invoke.MethodHandle applyMethod) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
applyToConsumerDefaultMP(Procedure proc,
CallContext ctx) |
Type |
getParameterType(int index) |
int |
isApplicable(Type[] argTypes,
Type restType)
Test if method is applicable to an invocation with given arguments.
|
static java.lang.RuntimeException |
matchFailAsException(int code,
Procedure proc,
ArgList args)
Helper method to throw an exception if a
matchX
method fails. |
static MethodProc |
mostSpecific(MethodProc proc1,
MethodProc proc2)
Return the more specific of the arguments.
|
int |
numParameters()
Return number of parameters, including optional and rest arguments.
|
static boolean |
overrideEquivalent(MethodProc proc1,
MethodProc proc2)
An approximation of "override-equivalent" as defined in the JLS.
|
protected void |
resolveParameterTypes()
Figure out or decode the parameter types, setting argTypes.
|
applyToObject
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, numArgs, set0, set1, setN, setSetter, setSourceLocation, toString
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
protected java.lang.Object argTypes
public static final int THROW_ON_EXCEPTION
public static final int NO_MATCH
public static final int NO_MATCH_TOO_FEW_ARGS
public static final int NO_MATCH_TOO_MANY_ARGS
public static final int NO_MATCH_AMBIGUOUS
public static final int NO_MATCH_BAD_TYPE
public static final int NO_MATCH_UNUSED_KEYWORD
public static final int NO_MATCH_GUARD_FALSE
public static final java.lang.invoke.MethodHandle applyToConsumerDefaultMP
public MethodProc()
public MethodProc(boolean resultGoesToConsumer, java.lang.invoke.MethodHandle applyMethod)
public int isApplicable(Type[] argTypes, Type restType)
argTypes
- 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.public int numParameters()
protected void resolveParameterTypes()
public Type getParameterType(int index)
public static java.lang.RuntimeException matchFailAsException(int code, Procedure proc, ArgList args)
matchX
method fails.public static MethodProc mostSpecific(MethodProc proc1, MethodProc proc2)
public static boolean overrideEquivalent(MethodProc proc1, MethodProc proc2)
public static java.lang.Object applyToConsumerDefaultMP(Procedure proc, CallContext ctx) throws java.lang.Throwable
java.lang.Throwable