KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > mapping > Setter0


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