Package org.opennms.core.utils
Class CollectionMath
- java.lang.Object
-
- org.opennms.core.utils.CollectionMath
-
public abstract class CollectionMath extends java.lang.ObjectCollectionMath 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.Numberaverage(java.util.List<? extends java.lang.Number> list)Get the average of the contents of aListofNumbervalues, excluding null entriesstatic longcountNotNull(java.util.List<?> list)Get the number of non-null entries in aListstatic longcountNull(java.util.List<?> list)Get the number of null entries in aListstatic java.lang.Numbermedian(java.util.List<? extends java.lang.Number> list)Get the median of the contents of aListofNumbervalues, excluding null entriesstatic java.lang.NumberpercentNotNull(java.util.List<? extends java.lang.Number> list)Get the percentage of not-null entries in aListofNumbervaluesstatic java.lang.NumberpercentNull(java.util.List<? extends java.lang.Number> list)Get the percentage of null entries in aListofNumbervalues
-
-
-
Method Detail
-
countNull
public static long countNull(java.util.List<?> list)
Get the number of null entries in aList- Parameters:
list- theList- Returns:
- the number of null entries
-
countNotNull
public static long countNotNull(java.util.List<?> list)
Get the number of non-null entries in aList- 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 aListofNumbervalues- Parameters:
list- theListofNumbervalues- Returns:
- the percentage of null values as a
Numbervalue
-
percentNotNull
public static java.lang.Number percentNotNull(java.util.List<? extends java.lang.Number> list)
Get the percentage of not-null entries in aListofNumbervalues- Parameters:
list- theListofNumbervalues- Returns:
- the percentage of not-null values as a
Numbervalue
-
average
public static java.lang.Number average(java.util.List<? extends java.lang.Number> list)
Get the average of the contents of aListofNumbervalues, excluding null entries- Parameters:
list- theListofNumbervalues- Returns:
- the average of the not-null values as a
Numbervalue
-
median
public static java.lang.Number median(java.util.List<? extends java.lang.Number> list)
Get the median of the contents of aListofNumbervalues, excluding null entries- Parameters:
list- theListofNumbervalues- Returns:
- the median of the not-null values as a
Numbervalue
-
-