KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > mapping > Procedure4


1 package gnu.mapping;
2
3 /**
4  * Abstract class for 4-argument Scheme procedures.
5  * @author Per Bothner
6  */

7
8 public abstract class Procedure4 extends Procedure
9 {
10   public Procedure4 ()
11   {
12     super();
13   }
14
15   public Procedure4(java.lang.String JavaDoc n)
16   {
17     super(n);
18   }
19
20   public int numArgs() { return 0x4004; }
21
22   public Object JavaDoc apply0 ()
23   {
24     throw new WrongArguments(this, 0);
25   }
26
27   public Object JavaDoc apply1 (Object JavaDoc arg1)
28   {
29     throw new WrongArguments(this, 1);
30   }
31
32   public Object JavaDoc apply2 (Object JavaDoc arg1, Object JavaDoc arg2)
33   {
34     throw new WrongArguments(this, 2);
35   }
36
37   public Object JavaDoc apply3 (Object JavaDoc arg1, Object JavaDoc arg2, Object JavaDoc arg3)
38   {
39     throw new WrongArguments(this, 3);
40   }
41
42   public abstract Object JavaDoc apply4(Object JavaDoc arg1,Object JavaDoc arg2,
43                 Object JavaDoc arg3,Object JavaDoc arg4) throws Throwable JavaDoc;
44
45   public Object JavaDoc applyN (Object JavaDoc[] args) throws Throwable JavaDoc
46   {
47     if (args.length != 4)
48       throw new WrongArguments(this, args.length);
49     return apply4 (args[0], args[1], args[2], args[3]);
50   }
51 }
52
Popular Tags