Class Median<T extends java.lang.Number & java.lang.Comparable<? super T>>

  • Type Parameters:
    T - a Number object which implements Comparable (In general every standard Java number)

    public class Median<T extends java.lang.Number & java.lang.Comparable<? super T>>
    extends java.lang.Object
    Math utility for calculating the median from Integer values.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double calculate()  
      static <T extends java.lang.Number & java.lang.Comparable<? super T>>
      Median<T>
      forList​(java.util.List<T> list)
      Creates a Median instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • forList

        public static <T extends java.lang.Number & java.lang.Comparable<? super T>> Median<T> forList​(java.util.List<T> list)
        Creates a Median instance.
        Type Parameters:
        T - Type of the number calculating median for
        Parameters:
        list - the input list
        Returns:
        an instance of Median for the List given
      • calculate

        public double calculate()