KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > mapping > Setter1


1 package gnu.mapping;
2
3 /** A special case of Setter, retricted to one argument (plus the RHS). */
4
5 public class Setter1 extends Setter
6 {
7   public Setter1(Procedure getter) { super(getter); }
8
9   public int numArgs() { return 0x2002; }
10
11   public Object JavaDoc apply2(Object JavaDoc arg, Object JavaDoc value) throws Throwable JavaDoc
12   { getter.set1(arg, value); return Values.empty; }
13
14   public Object JavaDoc applyN(Object JavaDoc[] args) throws Throwable JavaDoc
15   {
16     int nargs = args.length;
17     if (nargs != 2)
18       throw new WrongArguments(this, nargs);
19     getter.set1(args[0], args[1]);
20     return Values.empty;
21   }
22 }
23
Popular Tags