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