|
|||||||||
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 gnu.expr.ModuleMethod
public class ModuleMethod
Call a specified method in in a ModuleBody. We use an extra level of indirection, but we save by having to create fewer classes than in the one-class-per-procedure scheme, without having to use (slow) reflection.
Field Summary | |
---|---|
ModuleBody |
module
|
protected int |
numArgs
|
int |
selector
|
Fields inherited from class gnu.mapping.MethodProc |
---|
argTypes, NO_MATCH, NO_MATCH_AMBIGUOUS, NO_MATCH_BAD_TYPE, NO_MATCH_TOO_FEW_ARGS, NO_MATCH_TOO_MANY_ARGS |
Fields inherited from class gnu.mapping.ProcedureN |
---|
noArgs |
Constructor Summary | |
---|---|
ModuleMethod(ModuleBody module,
int selector,
java.lang.Object name,
int numArgs)
|
|
ModuleMethod(ModuleBody module,
int selector,
java.lang.Object name,
int numArgs,
java.lang.Object argTypes)
|
Method Summary | |
---|---|
void |
apply(CallContext ctx)
Call this Procedure using the explicit-CallContext-convention. |
java.lang.Object |
apply0()
|
static java.lang.Object |
apply0Default(ModuleMethod method)
|
java.lang.Object |
apply1(java.lang.Object arg1)
|
static java.lang.Object |
apply1Default(ModuleMethod method,
java.lang.Object arg1)
|
java.lang.Object |
apply2(java.lang.Object arg1,
java.lang.Object arg2)
|
static java.lang.Object |
apply2Default(ModuleMethod method,
java.lang.Object arg1,
java.lang.Object arg2)
|
java.lang.Object |
apply3(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
|
static java.lang.Object |
apply3Default(ModuleMethod method,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
|
java.lang.Object |
apply4(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
|
static java.lang.Object |
apply4Default(ModuleMethod method,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
|
static void |
applyError()
Helper methods for default ModuleBody actions. |
java.lang.Object |
applyN(java.lang.Object[] args)
|
static java.lang.Object |
applyNDefault(ModuleMethod method,
java.lang.Object[] args)
|
java.lang.String |
getName()
|
int |
match0(CallContext ctx)
Pass zero arguments. |
int |
match1(java.lang.Object arg1,
CallContext ctx)
Pass one argument. |
int |
match2(java.lang.Object arg1,
java.lang.Object arg2,
CallContext ctx)
Pass two arguments. |
int |
match3(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
CallContext ctx)
Pass three arguments. |
int |
match4(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
CallContext ctx)
Pass four arguments. |
int |
matchN(java.lang.Object[] args,
CallContext ctx)
|
int |
numArgs()
Return minArgs()|(maxArgs<<12). |
protected void |
resolveParameterTypes()
Figure out parameter types. |
Methods inherited from class gnu.mapping.MethodProc |
---|
getParameterType, isApplicable, matchFailAsException, mostSpecific, mostSpecific, numParameters |
Methods inherited from class gnu.mapping.Procedure |
---|
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getProperty, getSetter, getSymbol, maxArgs, minArgs, name, 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 |
---|
public ModuleBody module
public final int selector
protected int numArgs
Constructor Detail |
---|
public ModuleMethod(ModuleBody module, int selector, java.lang.Object name, int numArgs)
public ModuleMethod(ModuleBody module, int selector, java.lang.Object name, int numArgs, java.lang.Object argTypes)
Method Detail |
---|
public java.lang.String getName()
getName
in interface Named
getName
in class Procedure
protected void resolveParameterTypes()
resolveParameterTypes
in class MethodProc
public int numArgs()
Procedure
numArgs
in class Procedure
public int match0(CallContext ctx)
Procedure
match0
in class Procedure
public int match1(java.lang.Object arg1, CallContext ctx)
Procedure
match1
in class Procedure
public int match2(java.lang.Object arg1, java.lang.Object arg2, CallContext ctx)
Procedure
match2
in class Procedure
public int match3(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, CallContext ctx)
Procedure
match3
in class Procedure
public int match4(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, CallContext ctx)
Procedure
match4
in class Procedure
public int matchN(java.lang.Object[] args, CallContext ctx)
matchN
in class Procedure
public void apply(CallContext ctx) throws java.lang.Throwable
Procedure
apply
in class Procedure
java.lang.Throwable
public java.lang.Object apply0() throws java.lang.Throwable
apply0
in class ProcedureN
java.lang.Throwable
public java.lang.Object apply1(java.lang.Object arg1) throws java.lang.Throwable
apply1
in class ProcedureN
java.lang.Throwable
public java.lang.Object apply2(java.lang.Object arg1, java.lang.Object arg2) throws java.lang.Throwable
apply2
in class ProcedureN
java.lang.Throwable
public java.lang.Object apply3(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3) throws java.lang.Throwable
apply3
in class ProcedureN
java.lang.Throwable
public java.lang.Object apply4(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4) throws java.lang.Throwable
apply4
in class ProcedureN
java.lang.Throwable
public java.lang.Object applyN(java.lang.Object[] args) throws java.lang.Throwable
applyN
in class MethodProc
java.lang.Throwable
public static java.lang.Object apply0Default(ModuleMethod method) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object apply1Default(ModuleMethod method, java.lang.Object arg1) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object apply2Default(ModuleMethod method, java.lang.Object arg1, java.lang.Object arg2) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object apply3Default(ModuleMethod method, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object apply4Default(ModuleMethod method, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object applyNDefault(ModuleMethod method, java.lang.Object[] args) throws java.lang.Throwable
java.lang.Throwable
public static void applyError()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |