| java.lang.Object gnu.mapping.Procedure gnu.mapping.ProcedureN gnu.mapping.MethodProc
All known Subclasses: gnu.expr.PrimProcedure, gnu.expr.GenericProc, gnu.mapping.CpsProcedure,
MethodProc | abstract public class MethodProc extends ProcedureN (Code) | | Similar to a CLOS method.
Can check if arguments "match" before committing to calling method.
|
Field Summary | |
final public static int | NO_MATCH Return code from match: Unspecified failure. | final public static int | NO_MATCH_AMBIGUOUS Return code from match: Ambigious which method to select. | final public static int | NO_MATCH_BAD_TYPE Return code from match: Invalid argument type.
In that case the lower half is the 0-origin index of the first
argument that does not match. | final public static int | NO_MATCH_TOO_FEW_ARGS Return code from match: Too few actual arguments.
The lower half is the minimum number of arguments (if not 0xffff). | final public static int | NO_MATCH_TOO_MANY_ARGS Return code from match: Too many actual arguments.
The lower half is the maximum number of arguments (if not 0xffff). | protected Object | argTypes The parameter types.
Usually either an Type[] or a String encoding. | final static Type[] | unknownArgTypes |
NO_MATCH | final public static int NO_MATCH(Code) | | Return code from match: Unspecified failure.
|
NO_MATCH_AMBIGUOUS | final public static int NO_MATCH_AMBIGUOUS(Code) | | Return code from match: Ambigious which method to select.
|
NO_MATCH_BAD_TYPE | final public static int NO_MATCH_BAD_TYPE(Code) | | Return code from match: Invalid argument type.
In that case the lower half is the 0-origin index of the first
argument that does not match.
|
NO_MATCH_TOO_FEW_ARGS | final public static int NO_MATCH_TOO_FEW_ARGS(Code) | | Return code from match: Too few actual arguments.
The lower half is the minimum number of arguments (if not 0xffff).
|
NO_MATCH_TOO_MANY_ARGS | final public static int NO_MATCH_TOO_MANY_ARGS(Code) | | Return code from match: Too many actual arguments.
The lower half is the maximum number of arguments (if not 0xffff).
|
argTypes | protected Object argTypes(Code) | | The parameter types.
Usually either an Type[] or a String encoding.
|
unknownArgTypes | final static Type[] unknownArgTypes(Code) | | |
getParameterType | public Type getParameterType(int index)(Code) | | |
isApplicable | public int isApplicable(Type[] argTypes)(Code) | | Test if method is applicable to an invocation with given arguments.
Returns -1 if no; 1 if yes; 0 if need to check at run-time.
|
match | abstract public int match(CallContext ctx, Object[] args)(Code) | | Match the incoming arguments.
Parameters: ctx - where to save the matched result on success Parameters: args - the incoming argument list non-negative if the match succeeded, else negative |
mostSpecific | public static int mostSpecific(MethodProc[] procs, int length)(Code) | | Return the index of the most specific method.
|
numParameters | public int numParameters()(Code) | | Return number of parameters, including optional and rest arguments.
|
resolveParameterTypes | protected void resolveParameterTypes()(Code) | | Figure out or decode the parameter types, setting argTypes.
|
Methods inherited from gnu.mapping.Procedure | public void apply(Runnable ctx) throws Throwable(Code)(Java Doc) abstract public Object apply0() throws Throwable(Code)(Java Doc) abstract public Object apply1(Object arg1) throws Throwable(Code)(Java Doc) abstract public Object apply2(Object arg1, Object arg2) throws Throwable(Code)(Java Doc) abstract public Object apply3(Object arg1, Object arg2, Object arg3) throws Throwable(Code)(Java Doc) abstract public Object apply4(Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable(Code)(Java Doc) abstract public Object applyN(Object[] args) throws Throwable(Code)(Java Doc) public static void checkArgCount(Procedure proc, int argCount)(Code)(Java Doc) public String getName()(Code)(Java Doc) public Object getProperty(Object key, Object defaultValue)(Code)(Java Doc) public Procedure getSetter()(Code)(Java Doc) final public int maxArgs()(Code)(Java Doc) final public int minArgs()(Code)(Java Doc) final public String name()(Code)(Java Doc) public int numArgs()(Code)(Java Doc) public Object removeProperty(Object key)(Code)(Java Doc) public void set0(Object result) throws Throwable(Code)(Java Doc) public void set1(Object arg1, Object value) throws Throwable(Code)(Java Doc) public void setN(Object[] args) throws Throwable(Code)(Java Doc) final public void setName(String name)(Code)(Java Doc) public synchronized void setProperty(Object key, Object value)(Code)(Java Doc) public static Object[] setProperty(Object[] properties, Object key, Object value)(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|