GigaSpaces XAP 9.7.2 API

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

java.lang.Object
  extended by org.openspaces.core.executor.support.SumReducer<T,R>
      extended by org.openspaces.core.executor.support.AvgReducer<T,R>
All Implemented Interfaces:
AsyncResultsReducer<T,R>

public class AvgReducer<T extends Number,R extends Number>
extends SumReducer<T,R>

A default implementation of a reducer that averages all types T into a result R.

Author:
kimchy

Field Summary
 
Fields inherited from class org.openspaces.core.executor.support.SumReducer
redeuceHelper
 
Constructor Summary
AvgReducer(Class<R> reduceType)
           
 
Method Summary
 AvgReducer 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
 

Constructor Detail

AvgReducer

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

ignoreExceptions

public AvgReducer ignoreExceptions()
Causes the reducer to ignore exceptions and just sum the results that succeeded.

Overrides:
ignoreExceptions in class SumReducer<T extends Number,R extends Number>

reduce

public R reduce(List<AsyncResult<T>> results)
                        throws Exception
Specified by:
reduce in interface AsyncResultsReducer<T extends Number,R extends Number>
Overrides:
reduce in class SumReducer<T extends Number,R extends Number>
Throws:
Exception

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.