01: package gnu.mapping;
02:
03: /**
04: * Abstract class for 4-argument Scheme procedures.
05: * @author Per Bothner
06: */
07:
08: public abstract class Procedure4 extends Procedure {
09: public Procedure4() {
10: super ();
11: }
12:
13: public Procedure4(java.lang.String n) {
14: super (n);
15: }
16:
17: public int numArgs() {
18: return 0x4004;
19: }
20:
21: public Object apply0() {
22: throw new WrongArguments(this , 0);
23: }
24:
25: public Object apply1(Object arg1) {
26: throw new WrongArguments(this , 1);
27: }
28:
29: public Object apply2(Object arg1, Object arg2) {
30: throw new WrongArguments(this , 2);
31: }
32:
33: public Object apply3(Object arg1, Object arg2, Object arg3) {
34: throw new WrongArguments(this , 3);
35: }
36:
37: public abstract Object apply4(Object arg1, Object arg2,
38: Object arg3, Object arg4) throws Throwable;
39:
40: public Object applyN(Object[] args) throws Throwable {
41: if (args.length != 4)
42: throw new WrongArguments(this , args.length);
43: return apply4(args[0], args[1], args[2], args[3]);
44: }
45: }
|