01: package gnu.mapping;
02:
03: /** A special case of Setter, retricted to one argument (plus the RHS). */
04:
05: public class Setter1 extends Setter {
06: public Setter1(Procedure getter) {
07: super (getter);
08: }
09:
10: public int numArgs() {
11: return 0x2002;
12: }
13:
14: public Object apply2(Object arg, Object value) throws Throwable {
15: getter.set1(arg, value);
16: return Values.empty;
17: }
18:
19: public Object applyN(Object[] args) throws Throwable {
20: int nargs = args.length;
21: if (nargs != 2)
22: throw new WrongArguments(this , nargs);
23: getter.set1(args[0], args[1]);
24: return Values.empty;
25: }
26: }
|