TUM CCSM Commons

edu.tum.cs.commons.math
Class MedianAggregator

java.lang.Object
  extended by edu.tum.cs.commons.math.MedianAggregator
All Implemented Interfaces:
IAggregator

public class MedianAggregator
extends java.lang.Object
implements IAggregator

Median aggregator. Note that for an even number of elements this aggregator returns the mean value of both middle elements.

Version:
$Rev: 29788 $
Author:
deissenb, $Author: juergens $
Rating:
GREEN Hash: 263069760E186DA03CC4463A773263DD

Constructor Summary
MedianAggregator()
           
 
Method Summary
 double aggregate(java.util.Collection<? extends java.lang.Number> values)
          Aggregates by finding the median.
 double getNeutralElement()
          Returns Double.NaN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MedianAggregator

public MedianAggregator()
Method Detail

aggregate

public double aggregate(java.util.Collection<? extends java.lang.Number> values)
Aggregates by finding the median.

Specified by:
aggregate in interface IAggregator
Returns:
Double.NaN for empty input collection

getNeutralElement

public double getNeutralElement()
Returns Double.NaN.

Specified by:
getNeutralElement in interface IAggregator

TUM CCSM Commons

TUM CCSM Commons - 2.7