public class SumGroupCalculator extends AbstractGroupCalculator<BigDecimal,DefaultCalcIntermResult<BigDecimal>,Object>
Constructor and Description |
---|
SumGroupCalculator()
builds this group calculator with the default label
|
SumGroupCalculator(String label)
builds this group calculator with the given label
|
Modifier and Type | Method and Description |
---|---|
DefaultCalcIntermResult<BigDecimal> |
compute(DefaultCalcIntermResult<BigDecimal> intermResult,
Object newValue)
adds the new value to the previous intermediate result by converting it to BigDecimal.
|
DefaultCalcIntermResult<BigDecimal> |
init()
initializes with zero the intermediate result ( to start the sum computation)
|
getLabel
public static final String LABEL
public SumGroupCalculator()
public SumGroupCalculator(String label)
label
- the labelpublic DefaultCalcIntermResult<BigDecimal> init()
public DefaultCalcIntermResult<BigDecimal> compute(DefaultCalcIntermResult<BigDecimal> intermResult, Object newValue)
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)Copyright © 2006–2015. All rights reserved.