Class NumberUtils
- java.lang.Object
-
- dk.netarkivet.harvester.datamodel.NumberUtils
-
public class NumberUtils extends java.lang.Object
Number related utilities.
-
-
Constructor Summary
Constructors Constructor Description NumberUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
compareInf(long l1, long l2)
Compare two given positive longs, with the addition that -1 means infinity.static long
minInf(long l1, long l2)
Return the smallest value of two given positive longs, with the addition that -1 means infinity.static double[]
toPrimitiveArray(java.util.List<java.lang.Double> list)
Converts a list to an array of primitive values.
-
-
-
Constructor Detail
-
NumberUtils
public NumberUtils()
-
-
Method Detail
-
minInf
public static long minInf(long l1, long l2)
Return the smallest value of two given positive longs, with the addition that -1 means infinity.- Parameters:
l1
- The first valuel2
- The second value- Returns:
- Smallest value
-
compareInf
public static int compareInf(long l1, long l2)
Compare two given positive longs, with the addition that -1 means infinity.- Parameters:
l1
- The first valuel2
- The second value- Returns:
- -1 if first value is smallest, 0 if equal, 1 if second value is smallest
-
toPrimitiveArray
public static final double[] toPrimitiveArray(java.util.List<java.lang.Double> list)
Converts a list to an array of primitive values.- Parameters:
list
- the list to convert- Returns:
- an array of primitive values
-
-