org.shapelogic.calculation
Interface Accumulator<In,Out>

Type Parameters:
In -
Out -
All Superinterfaces:
CalcValue<Out>, java.util.Iterator<Out>, LazyCalc<Out>
All Known Implementing Classes:
BaseAccumulator, MaxAccumulator, SumAccumulator

public interface Accumulator<In,Out>
extends LazyCalc<Out>, java.util.Iterator<Out>

Accumulator. Used to calculate say sum or a stream or just an iterator.

Author:
Sami Badawi

Method Summary
 Out accumulate(In element, Out out)
          return element + out;
 java.util.Iterator<In> getInput()
           
 Out getPreviousValue()
           
 
Methods inherited from interface org.shapelogic.calculation.LazyCalc
isDirty, setup
 
Methods inherited from interface org.shapelogic.calculation.CalcValue
getValue
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

getInput

java.util.Iterator<In> getInput()

accumulate

Out accumulate(In element,
               Out out)
return element + out;


getPreviousValue

Out getPreviousValue()


Copyright © 2009. All Rights Reserved.