Example usage for Java org.apache.commons.lang3.math NumberUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
Long | LONG_ZERO Reusable Long constant for zero. |
Long | LONG_ONE Reusable Long constant for one. |
Integer | INTEGER_ZERO Reusable Integer constant for zero. |
Integer | INTEGER_ONE Reusable Integer constant for one. |
Short | SHORT_ZERO Reusable Short constant for zero. |
Byte | BYTE_ZERO Reusable Byte constant for zero. |
BigDecimal | createBigDecimal(final String str) Convert a Returns |
Double | createDouble(final String str) Convert a Returns |
Float | createFloat(final String str) Convert a Returns |
Integer | createInteger(final String str) Convert a |
Long | createLong(final String str) Convert a |
Number | createNumber(final String str) Turns a string value into a java.lang.Number. If the string starts with 0x or -0x (lower or upper case) or # or -# , it will be interpreted as a hexadecimal Integer - or Long, if the number of digits after the prefix is more than 8 - or BigInteger if there are more than 16 digits. |
boolean | isDigits(final String str) Checks whether the
|
boolean | isNumber(final String str) Checks whether the String a valid Java number. Valid numbers include hexadecimal marked with the |
boolean | isParsable(final String str) Checks whether the given String is a parsable number. Parsable numbers include those Strings understood by Integer#parseInt(String) , Long#parseLong(String) , Float#parseFloat(String) or Double#parseDouble(String) . |
long | max(final long... array) Returns the maximum value in an array. |
int | max(final int... array) Returns the maximum value in an array. |
short | max(final short... array) Returns the maximum value in an array. |
byte | max(final byte... array) Returns the maximum value in an array. |
double | max(final double... array) Returns the maximum value in an array. |
float | max(final float... array) Returns the maximum value in an array. |
long | max(long a, final long b, final long c) Gets the maximum of three |
int | max(int a, final int b, final int c) Gets the maximum of three |
short | max(short a, final short b, final short c) Gets the maximum of three |
byte | max(byte a, final byte b, final byte c) Gets the maximum of three |
double | max(final double a, final double b, final double c) Gets the maximum of three If any value is |
float | max(final float a, final float b, final float c) Gets the maximum of three If any value is |
long | min(long a, final long b, final long c) Gets the minimum of three |
int | min(int a, final int b, final int c) Gets the minimum of three |
short | min(short a, final short b, final short c) Gets the minimum of three |
byte | min(byte a, final byte b, final byte c) Gets the minimum of three |
double | min(final double a, final double b, final double c) Gets the minimum of three If any value is |
float | min(final float a, final float b, final float c) Gets the minimum of three If any value is |
long | min(final long... array) Returns the minimum value in an array. |
int | min(final int... array) Returns the minimum value in an array. |
short | min(final short... array) Returns the minimum value in an array. |
byte | min(final byte... array) Returns the minimum value in an array. |
double | min(final double... array) Returns the minimum value in an array. |
float | min(final float... array) Returns the minimum value in an array. |
byte | toByte(final String str) Convert a If the string is NumberUtils.toByte(null) = 0 NumberUtils.toByte("") = 0 NumberUtils.toByte("1") = 1 |
double | toDouble(final String str) Convert a If the string NumberUtils.toDouble(null) = 0.0d NumberUtils.toDouble("") = 0.0d NumberUtils.toDouble("1.5") = 1.5d |
double | toDouble(final String str, final double defaultValue) Convert a If the string NumberUtils.toDouble(null, 1.1d) = 1.1d NumberUtils.toDouble("", 1.1d) = 1.1d NumberUtils.toDouble("1.5", 0.0d) = 1.5d |
float | toFloat(final String str) Convert a If the string NumberUtils.toFloat(null) = 0.0f NumberUtils.toFloat("") = 0.0f NumberUtils.toFloat("1.5") = 1.5f |
float | toFloat(final String str, final float defaultValue) Convert a If the string NumberUtils.toFloat(null, 1.1f) = 1.0f NumberUtils.toFloat("", 1.1f) = 1.1f NumberUtils.toFloat("1.5", 0.0f) = 1.5f |
int | toInt(final String str, final int defaultValue) Convert a If the string is NumberUtils.toInt(null, 1) = 1 NumberUtils.toInt("", 1) = 1 NumberUtils.toInt("1", 0) = 1 |
int | toInt(final String str) Convert a If the string is NumberUtils.toInt(null) = 0 NumberUtils.toInt("") = 0 NumberUtils.toInt("1") = 1 |
long | toLong(final String str, final long defaultValue) Convert a If the string is NumberUtils.toLong(null, 1L) = 1L NumberUtils.toLong("", 1L) = 1L NumberUtils.toLong("1", 0L) = 1L |
long | toLong(final String str) Convert a If the string is NumberUtils.toLong(null) = 0L NumberUtils.toLong("") = 0L NumberUtils.toLong("1") = 1L |
short | toShort(final String str) Convert a If the string is NumberUtils.toShort(null) = 0 NumberUtils.toShort("") = 0 NumberUtils.toShort("1") = 1 |
short | toShort(final String str, final short defaultValue) Convert a If the string is NumberUtils.toShort(null, 1) = 1 NumberUtils.toShort("", 1) = 1 NumberUtils.toShort("1", 0) = 1 |