datafu.hourglass.model
Interface Accumulator<In,Out>

Type Parameters:
In - Input value type
Out - Output value type
All Superinterfaces:
java.io.Serializable

public interface Accumulator<In,Out>
extends java.io.Serializable

Collects a sequence of values and produces one value as a result.

Author:
"Matthew Hayes"

Method Summary
 void accumulate(In value)
          Accumulate another value.
 void cleanup()
          Resets the internal state so that all values accumulated so far are forgotten.
 Out getFinal()
          Get the output value corresponding to all input values accumulated so far.
 

Method Detail

accumulate

void accumulate(In value)
Accumulate another value.

Parameters:
value - Value to accumulate

getFinal

Out getFinal()
Get the output value corresponding to all input values accumulated so far.

This may return null to indicate no record should be written.

Returns:
Output value

cleanup

void cleanup()
Resets the internal state so that all values accumulated so far are forgotten.



Matthew Hayes