public class Calculations extends Object
| Constructor and Description |
|---|
Calculations() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(Object o1,
Object o2)
A common compareTo method for
String, Date, Float,
Double, Integer, Long, Short,
Byte, Calendar, and Boolean. |
static Collection<Object> |
getNonNullValues(Collection<Object> data)
Filter the array to return an array containing only non null values
|
static List<Number> |
getNumericValues(Collection<Object> data,
boolean strict)
Filter the array to return an array containing only numeric values
|
static Number |
sum(Collection<Object> data)
A common sum method for
Double, Float, Integer,
Long, Short, and Byte. |
public static int compare(Object o1, Object o2)
String, Date, Float,
Double, Integer, Long, Short,
Byte, Calendar, and Boolean.
Otherwise Object.toString() will be assumed.public static Number sum(Collection<Object> data)
Double, Float, Integer,
Long, Short, and Byte.
Otherwise, it will count the data length.public static Collection<Object> getNonNullValues(Collection<Object> data)
public static List<Number> getNumericValues(Collection<Object> data, boolean strict)
Copyright © 2023. All rights reserved.