Package org.apache.solr.analytics.util
Class MedianCalculator
- java.lang.Object
-
- org.apache.solr.analytics.util.MedianCalculator
-
public class MedianCalculator extends Object
Only used for testing. Medians are calculated with theOrdinalCalculator
for actual analytics requests.
-
-
Constructor Summary
Constructors Constructor Description MedianCalculator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Number & Comparable<T>>
doublegetMedian(List<T> list)
Calculates the median of the given list of numbers.
-
-
-
Method Detail
-
getMedian
public static <T extends Number & Comparable<T>> double getMedian(List<T> list)
Calculates the median of the given list of numbers.- Parameters:
list
- A list ofComparable
Number
objects- Returns:
- The median of the given list as a double.
-
-