01: package gnu.mapping;
02:
03: /**
04: * Abstract class for 3-argument Scheme procedures..
05: * @author Per Bothner
06: */
07:
08: public abstract class Procedure3 extends Procedure {
09: public Procedure3() {
10: super ();
11: }
12:
13: public Procedure3(java.lang.String n) {
14: super (n);
15: }
16:
17: public int numArgs() {
18: return 0x3003;
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 abstract Object apply3(Object arg1, Object arg2, Object arg3)
34: throws Throwable;
35:
36: public Object apply4(Object arg1, Object arg2, Object arg3,
37: Object arg4) {
38: throw new WrongArguments(this , 4);
39: }
40:
41: public Object applyN(Object[] args) throws Throwable {
42: if (args.length != 3)
43: throw new WrongArguments(this , args.length);
44: return apply3(args[0], args[1], args[2]);
45: }
46: }
|