|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.Procedure gnu.mapping.ProcedureN gnu.mapping.MethodProc
public abstract class MethodProc
Similar to a CLOS method. Can check if arguments "match" before committing to calling method.
Field Summary | |
---|---|
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_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. |
Fields inherited from class gnu.mapping.ProcedureN |
---|
noArgs |
Constructor Summary | |
---|---|
MethodProc()
|
Method Summary | |
---|---|
java.lang.Object |
applyN(java.lang.Object[] args)
|
Type |
getParameterType(int index)
|
int |
isApplicable(Type[] argTypes)
Test if method is applicable to an invocation with given arguments. |
static java.lang.RuntimeException |
matchFailAsException(int code,
Procedure proc,
java.lang.Object[] args)
Helper method to throw an exception if a matchX
method fails. |
static int |
mostSpecific(MethodProc[] procs,
int length)
Return the index of the most specific method. |
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. |
protected void |
resolveParameterTypes()
Figure out or decode the parameter types, setting argTypes. |
Methods inherited from class gnu.mapping.ProcedureN |
---|
apply0, apply1, apply2, apply3, apply4 |
Methods inherited from class gnu.mapping.Procedure |
---|
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object argTypes
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
Constructor Detail |
---|
public MethodProc()
Method Detail |
---|
public int isApplicable(Type[] argTypes)
public int numParameters()
protected void resolveParameterTypes()
public Type getParameterType(int index)
public static java.lang.RuntimeException matchFailAsException(int code, Procedure proc, java.lang.Object[] args)
matchX
method fails.
public java.lang.Object applyN(java.lang.Object[] args) throws java.lang.Throwable
applyN
in class ProcedureN
java.lang.Throwable
public static MethodProc mostSpecific(MethodProc proc1, MethodProc proc2)
public static int mostSpecific(MethodProc[] procs, int length)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |