public class FirstGroupCalculator<T> extends AbstractGroupCalculator<T,FirstCalcIntermResult<T>,T>
compute(FirstCalcIntermResult, Object)
it will always
return the first valueConstructor and Description |
---|
FirstGroupCalculator()
builds this group calculator with the default label
|
FirstGroupCalculator(String label)
builds this group calculator with a custom label
|
Modifier and Type | Method and Description |
---|---|
FirstCalcIntermResult<T> |
compute(FirstCalcIntermResult<T> intermResult,
T newValue)
if the previous result is first then it stores the new value inside the intermediate result.
|
FirstCalcIntermResult<T> |
init()
returns an empty (null) element with the isFirst flag = true
|
getLabel
public static final String LABEL
public FirstGroupCalculator()
public FirstGroupCalculator(String label)
label
- the labelpublic FirstCalcIntermResult<T> init()
public FirstCalcIntermResult<T> compute(FirstCalcIntermResult<T> intermResult, T 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.