org.opennms.core.utils
Class CollectionMath

java.lang.Object
  extended by org.opennms.core.utils.CollectionMath

public class CollectionMath
extends Object


Constructor Summary
CollectionMath()
           
 
Method Summary
static BigDecimal average(List<BigDecimal> list)
          Get the average of the contents of a List of BigDecimal values, excluding null entries
static Number average(List<Number> list)
          Get the average of the contents of a List of Number values, excluding null entries
static long countNotNull(List list)
          Get the number of non-null entries in a List
static long countNull(List list)
          Get the number of null entries in a List
static BigDecimal median(List<BigDecimal> list)
          Get the median of the contents of a List of BigDecimal values, excluding null entries
static Number median(List<Number> list)
          Get the median of the contents of a List of Number values, excluding null entries
static BigDecimal percentNotNull(List<BigDecimal> list)
          Get the percentage of not-null entries in a List of BigDecimal values
static Number percentNotNull(List<Number> list)
          Get the percentage of not-null entries in a List of Number values
static BigDecimal percentNull(List<BigDecimal> list)
          Get the percentage of null entries in a List of BigDecimal values
static Number percentNull(List<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(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(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 Number percentNull(List<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

percentNull

public static BigDecimal percentNull(List<BigDecimal> list)
Get the percentage of null entries in a List of BigDecimal values

Parameters:
list - the List of BigDecimal values
Returns:
the percentage of null values as a BigDecimal value

percentNotNull

public static Number percentNotNull(List<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

percentNotNull

public static BigDecimal percentNotNull(List<BigDecimal> list)
Get the percentage of not-null entries in a List of BigDecimal values

Parameters:
list - the List of BigDecimal values
Returns:
the percentage of not-null values as a BigDecimal value

average

public static Number average(List<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

average

public static BigDecimal average(List<BigDecimal> list)
Get the average of the contents of a List of BigDecimal values, excluding null entries

Parameters:
list - the List of BigDecimal values
Returns:
the average of the not-null values as a BigDecimal value

median

public static Number median(List<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

median

public static BigDecimal median(List<BigDecimal> list)
Get the median of the contents of a List of BigDecimal values, excluding null entries

Parameters:
list - the List of BigDecimal values
Returns:
the median of the not-null values as a BigDecimal value


Copyright ? 2007. All Rights Reserved.