de.erichseifert.gral.util
Class DataUtils
- java.lang.Object
-
- de.erichseifert.gral.util.DataUtils
-
public abstract class DataUtils extends java.lang.ObjectAbstract class that contains utility functions for creating data structures and for working with data sources and values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublegetValueOrDefault(java.lang.Number n, double defaultValue)Returns the double value of theNumberobject or the specified default value if the object isnull.static <K,V> java.util.Map<K,V>map(K[] keys, V[] values)Creates a mapping from two arrays, one with keys, one with values.
-
-
-
Method Detail
-
map
public static <K,V> java.util.Map<K,V> map(K[] keys, V[] values)Creates a mapping from two arrays, one with keys, one with values.- Type Parameters:
K- Data type of the keys.V- Data type of the values.- Parameters:
keys- Array containing the keys.values- Array containing the values.- Returns:
- Map with keys and values from the specified arrays.
-
getValueOrDefault
public static double getValueOrDefault(java.lang.Number n, double defaultValue)Returns the double value of theNumberobject or the specified default value if the object isnull.- Parameters:
n- Number object.defaultValue- Default value.- Returns:
- Double value of the
Numberobject or the default value if the object isnull
-
-
DataMelt 3.0 © DataMelt by jWork.ORG