KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > parsec > ArrayAccumulator


1 /**
2  *
3  */

4 package jfun.parsec;
5
6 class ArrayAccumulator<E, T extends E> implements
7     Accumulator<T, E[]> {
8   public void accumulate(final T o) {
9     l.add(o);
10   }
11
12   public E[] getResult() {
13     return ParserInternals.getArrayResult(l, af);
14   }
15
16   private final java.util.ArrayList JavaDoc<T> l;
17
18   private final ArrayFactory<E> af;
19
20   ArrayAccumulator(final ArrayFactory<E> af, final java.util.ArrayList JavaDoc<T> al) {
21     this.af = af;
22     this.l = al;
23   }
24 }
Popular Tags