net.sf.staccatocommons.defs.reduction
Interface Accumulator<A,B>

Type Parameters:
A - the type of the input accumulated value
B - the type of the output accumulated value
All Superinterfaces:
Thunk<B>

public interface Accumulator<A,B>
extends Thunk<B>

An imperative accumulator. See Reduction for more details.

Since:
1.2
Author:
flbulgarelli

Method Summary
 void accumulate(A element)
          Adds an element to this accumulator
 B value()
          Answers the accumulated value
 

Method Detail

accumulate

void accumulate(A element)
Adds an element to this accumulator

Parameters:
element - the element to add.

value

B value()
Answers the accumulated value

Specified by:
value in interface Thunk<B>
Returns:
the provided object. It is sometimes referred as the thunk's element


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads