Class IntSumReducer
- java.lang.Object
-
- org.apache.ignite.internal.util.lang.gridfunc.IntSumReducer
-
- All Implemented Interfaces:
Serializable,IgniteReducer<Integer,Integer>
public class IntSumReducer extends Object implements IgniteReducer<Integer,Integer>
Reducer that calculates sum of integer elements.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntSumReducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancollect(Integer e)Collects given value.Integerreduce()Reduces collected values into one.StringtoString()
-
-
-
Method Detail
-
collect
public boolean collect(Integer e)
Collects given value. If this method returnsfalsethenIgniteReducer.reduce()will be called right away. Otherwise caller will continue collecting until all values are processed.- Specified by:
collectin interfaceIgniteReducer<Integer,Integer>- Parameters:
e- Value to collect.- Returns:
trueto continue collecting,falseto instruct caller to stop collecting and callIgniteReducer.reduce()method.
-
reduce
public Integer reduce()
Reduces collected values into one.- Specified by:
reducein interfaceIgniteReducer<Integer,Integer>- Returns:
- Reduced value.
-
-