org.openspaces.core.executor.support
Class SumReducer<T extends Number,R extends Number>
java.lang.Object
org.openspaces.core.executor.support.SumReducer<T,R>
- All Implemented Interfaces:
- AsyncResultsReducer<T,R>
- Direct Known Subclasses:
- AvgReducer
public class SumReducer<T extends Number,R extends Number>
- extends Object
- implements AsyncResultsReducer<T,R>
A default implementation of a reducer that sums all types T
into a result R
.
- Author:
- kimchy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
redeuceHelper
protected final NumberHelper<R extends Number> redeuceHelper
SumReducer
public SumReducer(Class<R> reduceType)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
ignoreExceptions
public SumReducer ignoreExceptions()
- Causes the reducer to ignore exceptions and just sum the results that succeeded.
reduce
public R reduce(List<AsyncResult<T>> results)
throws Exception
- Specified by:
reduce
in interface AsyncResultsReducer<T extends Number,R extends Number>
- Throws:
Exception
Copyright © GigaSpaces.