Package org.zkoss.pivot.impl.util
Class Calculations
- java.lang.Object
-
- org.zkoss.pivot.impl.util.Calculations
-
public class Calculations extends Object
A utility class for the pivot package.- Author:
- jumperchen
-
-
Constructor Summary
Constructors Constructor Description Calculations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompare(Object o1, Object o2)A common compareTo method forString,Date,Float,Double,Integer,Long,Short,Byte,Calendar, andBoolean.static Collection<Object>getNonNullValues(Collection<Object> data)Filter the array to return an array containing only non null valuesstatic List<Number>getNumericValues(Collection<Object> data, boolean strict)Filter the array to return an array containing only numeric valuesstatic Numbersum(Collection<Object> data)A common sum method forDouble,Float,Integer,Long,Short, andByte.
-
-
-
Method Detail
-
compare
public static int compare(Object o1, Object o2)
A common compareTo method forString,Date,Float,Double,Integer,Long,Short,Byte,Calendar, andBoolean. Otherwise Object.toString() will be assumed.
-
sum
public static Number sum(Collection<Object> data)
A common sum method forDouble,Float,Integer,Long,Short, andByte. Otherwise, it will count the data length.
-
getNonNullValues
public static Collection<Object> getNonNullValues(Collection<Object> data)
Filter the array to return an array containing only non null values
-
getNumericValues
public static List<Number> getNumericValues(Collection<Object> data, boolean strict)
Filter the array to return an array containing only numeric values
-
-