| Modifier and Type | Field and Description |
|---|---|
| public static final Byte | BYTE_MINUS_ONE
Reusable Byte constant for minus one. |
| public static final Byte | BYTE_ONE
Reusable Byte constant for one. |
| public static final Byte | BYTE_ZERO
Reusable Byte constant for zero. |
| public static final Double | DOUBLE_MINUS_ONE
Reusable Double constant for minus one. |
| public static final Double | DOUBLE_ONE
Reusable Double constant for one. |
| public static final Double | DOUBLE_ZERO
Reusable Double constant for zero. |
| public static final Float | FLOAT_MINUS_ONE
Reusable Float constant for minus one. |
| public static final Float | FLOAT_ONE
Reusable Float constant for one. |
| public static final Float | FLOAT_ZERO
Reusable Float constant for zero. |
| public static final Integer | INTEGER_MINUS_ONE
Reusable Integer constant for minus one. |
| public static final Integer | INTEGER_ONE
Reusable Integer constant for one. |
| public static final Integer | INTEGER_TWO
Reusable Integer constant for two |
| public static final Integer | INTEGER_ZERO
Reusable Integer constant for zero. |
| public static final Long | |
| public static final Long | |
| public static final Long | LONG_MINUS_ONE
Reusable Long constant for minus one. |
| public static final Long | LONG_ONE
Reusable Long constant for one. |
| public static final Long | LONG_ZERO
Reusable Long constant for zero. |
| public static final Short | SHORT_MINUS_ONE
Reusable Short constant for minus one. |
| public static final Short | SHORT_ONE
Reusable Short constant for one. |
| public static final Short | SHORT_ZERO
Reusable Short constant for zero. |
| Access | Constructor and Description |
|---|---|
| public | NumberUtils()
Deprecated
TODO Make private in 4.0.
|
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: the value0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y.the first x, final byte byte to compare.the second y)byte to compare.
Deprecated
Use
Byte#compare(byte, byte).
Compares two |
| public static int | Returns: the value0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y.the first x, final int int to compare.the second y)int to compare.
Deprecated
Use
Integer#compare(int, int).
Compares two |
| public static int | Returns: the value0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y.the first x, final long long to compare.the second y)long to compare.
Deprecated
Use
Long#compare(long, long).
Compares to |
| public static int | Returns: the value0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y.the first x, final short short to compare.the second y)short to compare.
Deprecated
Use
Short#compare(short, short).
Compares to |
| public static BigDecimal | Returns: convertedBigDecimal (or null if the input is null).a str)String to convert, may be null.Creates a |
| public static BigInteger | Returns: convertedBigInteger (or null if the input is null).a str)String to convert, may be null.Creates a |
| public static Double | |
| public static Float | |
| public static Integer | |
| public static Long | |
| public static Number | Returns: Number created from the string (or null if the input is null).String containing a number, may be null. str) |
| private static String | Returns: mantissa of the given number.the string representation of the number. str, final int the position of the exponent or decimal point. stopPos)Utility method for |
| private static boolean | Returns: if it is all zeros ornull.the String to check. str)Utility method for |
| public static boolean | Returns: true if the string is a correctly formatted number.the str)String to check.Checks whether the String is a valid Java number. |
| public static boolean | |
| public static boolean | Returns: true if the string is a correctly formatted number.the str)String to check.
Deprecated
This feature will be removed in Lang 4, use
NumberUtils#isCreatable(String) instead.
Checks whether the String is a valid Java number. |
| public static boolean | Returns: true if the string is a parsable number.the String to check. str)Checks whether the given String is a parsable number. |
| private static boolean | |
| private static boolean | Returns: true if the magnitude is zero.the mantissa decimal digits before the decimal point (sign must be removed; never null). mant, final String the decimal digits after the decimal point (exponent and type specifier removed; can be null) dec)Utility method for |
| public static byte | Returns: the maximum value in the array.an array, must not be null or empty. array)Returns the maximum value in an array. |
| public static byte | Returns: the largest of the values.value 1. a, final byte value 2. b, final byte value 3. c)Gets the maximum of three |
| public static double | Returns: the maximum value in the array.an array, must not be null or empty. array)Returns the maximum value in an array. |
| public static double | Returns: the largest of the values.value 1. a, final double value 2. b, final double value 3. c)Gets the maximum of three |
| public static float | Returns: the maximum value in the array.an array, must not be null or empty. array)Returns the maximum value in an array. |
| public static float | Returns: the largest of the values.value 1. a, final float value 2. b, final float value 3. c)Gets the maximum of three |
| public static int | Returns: the maximum value in the array.an array, must not be null or empty. array)Returns the maximum value in an array. |
| public static int | Returns: the largest of the values.value 1. a, final int value 2. b, final int value 3. c)Gets the maximum of three |
| public static long | Returns: the maximum value in the array.an array, must not be null or empty. array)Returns the maximum value in an array. |
| public static long | Returns: the largest of the values.value 1. a, final long value 2. b, final long value 3. c)Gets the maximum of three |
| public static short | Returns: the maximum value in the array.an array, must not be null or empty. array)Returns the maximum value in an array. |
| public static short | Returns: the largest of the values.value 1. a, final short value 2. b, final short value 3. c)Gets the maximum of three |
| public static byte | Returns: the minimum value in the array.an array, must not be null or empty. array)Returns the minimum value in an array. |
| public static byte | Returns: the smallest of the values.value 1. a, final byte value 2. b, final byte value 3. c)Gets the minimum of three |
| public static double | Returns: the minimum value in the array.an array, must not be null or empty. array)Returns the minimum value in an array. |
| public static double | Returns: the smallest of the values.value 1. a, final double value 2. b, final double value 3. c)Gets the minimum of three |
| public static float | Returns: the minimum value in the array.an array, must not be null or empty. array)Returns the minimum value in an array. |
| public static float | Returns: the smallest of the values.value 1. a, final float value 2. b, final float value 3. c)Gets the minimum of three |
| public static int | Returns: the minimum value in the array.an array, must not be null or empty. array)Returns the minimum value in an array. |
| public static int | Returns: the smallest of the values.value 1. a, final int value 2. b, final int value 3. c)Gets the minimum of three |
| public static long | Returns: the minimum value in the array.an array, must not be null or empty. array)Returns the minimum value in an array. |
| public static long | Returns: the smallest of the values.value 1. a, final long value 2. b, final long value 3. c)Gets the minimum of three |
| public static short | Returns: the minimum value in the array.an array, must not be null or empty. array)Returns the minimum value in an array. |
| public static short | Returns: the smallest of the values.value 1. a, final short value 2. b, final short value 3. c)Gets the minimum of three |
| public static byte | |
| public static byte | |
| public static double | toDouble(final BigDecimal
the value)BigDecimal to convert, may be null.Converts a |
| public static double | toDouble(final BigDecimal
the value, final double BigDecimal to convert, may be null.the default value. defaultValue)Converts a |
| public static double | |
| public static double | |
| public static float | |
| public static float | |
| public static int | |
| public static int | |
| public static long | |
| public static long | |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value)BigDecimal to convert, may be null.Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value, final int BigDecimal to convert, may be null.the number of digits to the right of the decimal point. scale, final RoundingMode a rounding behavior for numerical operations capable of discarding precision. roundingMode)Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value)Double to convert, may be null.Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value, final int Double to convert, may be null.the number of digits to the right of the decimal point. scale, final RoundingMode a rounding behavior for numerical operations capable of discarding precision. roundingMode)Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value)Float to convert, may be null.Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value, final int Float to convert, may be null.the number of digits to the right of the decimal point. scale, final RoundingMode a rounding behavior for numerical operations capable of discarding precision. roundingMode)Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value)String to convert, may be null.Converts a |
| public static BigDecimal | Returns: the scaled, with appropriate rounding,BigDecimal.the value, final int String to convert, may be null.the number of digits to the right of the decimal point. scale, final RoundingMode a rounding behavior for numerical operations capable of discarding precision. roundingMode)Converts a |
| public static short | |
| public static short | |
| private static void | validateArray(final Object
the array to check. array)Checks if the specified array is neither null nor empty. |
| private static boolean |