/** An interface for classes which provide the service of accumulating strings bit by bit. The notional state of a string accumulator is a string; his is initially empty, and when {@link #accumulate} is called, the toString of the argument is added to the end of the state. */ public interface StringAccumulator { /** Adds the toString of the parameter to the accumulator. @param obj the object whose toString to accumulate; this may not be null */ public void accumulate(Object obj); /** Exactly the same as {@link #accumulate(java.lang.Object)}. Provided as a convenience. @param str the string to accumulate; this may not be null */ public void accumulate(String str); /** @return the @throws {@link java.lang.IllegalStateException} if toString has already been called and this accumulator does not support repeated toStringing */ public String toString(); }