01: // Copyright (c) 2002 Per M.A. Bothner and Brainfood Inc.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.xml;
05:
06: import gnu.mapping.*;
07: import gnu.lists.*; /* #ifdef JAVA2 */
08: import java.util.Iterator;
09:
10: /* #endif */
11:
12: /* A function that maps an Iterator into the sequence of ite elements. */
13:
14: public class IteratorItems extends MethodProc {
15: public static IteratorItems iteratorItems = new IteratorItems();
16:
17: public void apply(CallContext ctx) {
18: Consumer out = ctx.consumer;
19: Object arg = ctx.getNextArg();
20: ctx.lastArg();
21:
22: /* #ifdef JAVA2 */
23: Iterator iter = (Iterator) arg;
24: /* #endif */
25: /* #ifndef JAVA2 */
26: // SeqPosition iter = (SeqPosition) arg;
27: /* #endif */
28: while (iter.hasNext()) {
29: Object val = iter.next();
30: Values.writeValues(val, out);
31: }
32: }
33: }
|