org.zkoss.pivot.impl.util
Class Calculations

java.lang.Object
  extended by org.zkoss.pivot.impl.util.Calculations

public class Calculations
extends java.lang.Object

A utility class for the pivot package.

Author:
jumperchen

Constructor Summary
Calculations()
           
 
Method Summary
static int compare(java.lang.Object o1, java.lang.Object o2)
          A common compareTo method for String, Date, Float, Double, Integer, Long, Short, Byte, Calendar, and Boolean.
static java.util.Collection<java.lang.Object> getNonNullValues(java.util.Collection<java.lang.Object> data)
          Filter the array to return an array containing only non null values
static java.util.List<java.lang.Number> getNumericValues(java.util.Collection<java.lang.Object> data, boolean strict)
          Filter the array to return an array containing only numeric values
static java.lang.Number sum(java.util.Collection<java.lang.Object> data)
          A common sum method for Double, Float, Integer, Long, Short, and Byte.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calculations

public Calculations()
Method Detail

compare

public static int compare(java.lang.Object o1,
                          java.lang.Object o2)
A common compareTo method for String, Date, Float, Double, Integer, Long, Short, Byte, Calendar, and Boolean. Otherwise Object.toString() will be assumed.


sum

public static java.lang.Number sum(java.util.Collection<java.lang.Object> data)
A common sum method for Double, Float, Integer, Long, Short, and Byte. Otherwise, it will count the data length.


getNonNullValues

public static java.util.Collection<java.lang.Object> getNonNullValues(java.util.Collection<java.lang.Object> data)
Filter the array to return an array containing only non null values


getNumericValues

public static java.util.List<java.lang.Number> getNumericValues(java.util.Collection<java.lang.Object> data,
                                                                boolean strict)
Filter the array to return an array containing only numeric values



Copyright © 2012. All Rights Reserved.