Class CollectionMath


  • public abstract class CollectionMath
    extends java.lang.Object

    CollectionMath class.

    Version:
    $Id: $
    Author:
    Benjamin Reed
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectionMath()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Number average​(java.util.List<? extends java.lang.Number> list)
      Get the average of the contents of a List of Number values, excluding null entries
      static long countNotNull​(java.util.List<?> list)
      Get the number of non-null entries in a List
      static long countNull​(java.util.List<?> list)
      Get the number of null entries in a List
      static java.lang.Number median​(java.util.List<? extends java.lang.Number> list)
      Get the median of the contents of a List of Number values, excluding null entries
      static java.lang.Number percentNotNull​(java.util.List<? extends java.lang.Number> list)
      Get the percentage of not-null entries in a List of Number values
      static java.lang.Number percentNull​(java.util.List<? extends java.lang.Number> list)
      Get the percentage of null entries in a List of Number values
      • Methods inherited from class java.lang.Object

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

      • CollectionMath

        public CollectionMath()
    • Method Detail

      • countNull

        public static long countNull​(java.util.List<?> list)
        Get the number of null entries in a List
        Parameters:
        list - the List
        Returns:
        the number of null entries
      • countNotNull

        public static long countNotNull​(java.util.List<?> list)
        Get the number of non-null entries in a List
        Parameters:
        list - the list
        Returns:
        the number of non-null entries
      • percentNull

        public static java.lang.Number percentNull​(java.util.List<? extends java.lang.Number> list)
        Get the percentage of null entries in a List of Number values
        Parameters:
        list - the List of Number values
        Returns:
        the percentage of null values as a Number value
      • percentNotNull

        public static java.lang.Number percentNotNull​(java.util.List<? extends java.lang.Number> list)
        Get the percentage of not-null entries in a List of Number values
        Parameters:
        list - the List of Number values
        Returns:
        the percentage of not-null values as a Number value
      • average

        public static java.lang.Number average​(java.util.List<? extends java.lang.Number> list)
        Get the average of the contents of a List of Number values, excluding null entries
        Parameters:
        list - the List of Number values
        Returns:
        the average of the not-null values as a Number value
      • median

        public static java.lang.Number median​(java.util.List<? extends java.lang.Number> list)
        Get the median of the contents of a List of Number values, excluding null entries
        Parameters:
        list - the List of Number values
        Returns:
        the median of the not-null values as a Number value