public interface GroupCalculator<R,I extends CalcIntermResult<R>,V>
Modifier and Type | Method and Description |
---|---|
I |
compute(I intermResult,
V newValue)
compute the new value with the previous result and return a new result.
|
String |
getLabel()
returns the label to be displayed at the beginning of the total row.
|
I |
init()
this is used for initializing the intermediate result.
|
I init()
Example: for a COUNT calculator the initial value should be zero
(well, actually it should be an implementation of CalcIntermResult
I compute(I intermResult, V newValue)
Example: for a COUNT calculator after computing 10 records the next call to this method should be : compute(10, "whatever text"). This call should return 11.
intermResult
- the previous intermediate result ( it's the 10 in my example)newValue
- the current value (it's the "whatever text" in my example above)String getLabel()
Copyright © 2006–2015. All rights reserved.