1 /***************************************************************************** 2 * Copyright (C) Zephyr Business Solutions Corp. All rights reserved. * 3 * ------------------------------------------------------------------------- * 4 * The software in this package is published under the terms of the BSD * 5 * style license a copy of which has been included with this distribution in * 6 * the LICENSE.txt file. * 7 *****************************************************************************/ 8 package jfun.parsec; 9 10 /** 11 * Used to accumulate objects. 12 * Parsers.manyAccum() use Accumulator to collect return values. 13 * Can be parameterized as Accumulator<T,R> 14 * @author Ben Yu 15 * 16 * 2004-11-12 17 */ 18 public interface Accumulator<From,To> extends java.io.Serializable{ 19 /** 20 * accumulate one object into the result. 21 * @param obj the object to be accumulated. 22 */ 23 void accumulate(From obj); 24 /** 25 * gets the accumulated result. 26 * @return the result. 27 */ 28 To getResult(); 29 } 30