GigaSpaces XAP 9.0 API

org.openspaces.core.executor.support
Class SumReducer<T extends Number,R extends Number>

java.lang.Object
  extended by 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

Field Summary
protected  NumberHelper<R> redeuceHelper
           
 
Constructor Summary
SumReducer(Class<R> reduceType)
           
 
Method Summary
 SumReducer ignoreExceptions()
          Causes the reducer to ignore exceptions and just sum the results that succeeded.
 R reduce(List<AsyncResult<T>> results)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

redeuceHelper

protected final NumberHelper<R extends Number> redeuceHelper
Constructor Detail

SumReducer

public SumReducer(Class<R> reduceType)
           throws IllegalArgumentException
Throws:
IllegalArgumentException
Method Detail

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

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.