Class NumberUtils
- java.lang.Object
 - 
- org.apache.commons.lang.math.NumberUtils
 
 
- 
@Deprecated(since="2021-04-30") public class NumberUtils extends java.lang.ObjectDeprecated.Commons Lang 2 is in maintenance mode. Commons Lang 3 should be used instead.Provides extra functionality for Java Number classes.
- Since:
 - 2.0
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.ByteBYTE_MINUS_ONEDeprecated.Reusable Byte constant for minus one.static java.lang.ByteBYTE_ONEDeprecated.Reusable Byte constant for one.static java.lang.ByteBYTE_ZERODeprecated.Reusable Byte constant for zero.static java.lang.DoubleDOUBLE_MINUS_ONEDeprecated.Reusable Double constant for minus one.static java.lang.DoubleDOUBLE_ONEDeprecated.Reusable Double constant for one.static java.lang.DoubleDOUBLE_ZERODeprecated.Reusable Double constant for zero.static java.lang.FloatFLOAT_MINUS_ONEDeprecated.Reusable Float constant for minus one.static java.lang.FloatFLOAT_ONEDeprecated.Reusable Float constant for one.static java.lang.FloatFLOAT_ZERODeprecated.Reusable Float constant for zero.static java.lang.IntegerINTEGER_MINUS_ONEDeprecated.Reusable Integer constant for minus one.static java.lang.IntegerINTEGER_ONEDeprecated.Reusable Integer constant for one.static java.lang.IntegerINTEGER_ZERODeprecated.Reusable Integer constant for zero.static java.lang.LongLONG_MINUS_ONEDeprecated.Reusable Long constant for minus one.static java.lang.LongLONG_ONEDeprecated.Reusable Long constant for one.static java.lang.LongLONG_ZERODeprecated.Reusable Long constant for zero.static java.lang.ShortSHORT_MINUS_ONEDeprecated.Reusable Short constant for minus one.static java.lang.ShortSHORT_ONEDeprecated.Reusable Short constant for one.static java.lang.ShortSHORT_ZERODeprecated.Reusable Short constant for zero. 
- 
Constructor Summary
Constructors Constructor Description NumberUtils()Deprecated.NumberUtilsinstances should NOT be constructed in standard programming. 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intcompare(double lhs, double rhs)Deprecated.Compares twodoublesfor order.static intcompare(float lhs, float rhs)Deprecated.Compares two floats for order.static java.math.BigDecimalcreateBigDecimal(java.lang.String str)Deprecated.Convert aStringto aBigDecimal.static java.math.BigIntegercreateBigInteger(java.lang.String str)Deprecated.Convert aStringto aBigInteger.static java.lang.DoublecreateDouble(java.lang.String str)Deprecated.Convert aStringto aDouble.static java.lang.FloatcreateFloat(java.lang.String str)Deprecated.Convert aStringto aFloat.static java.lang.IntegercreateInteger(java.lang.String str)Deprecated.Convert aStringto aInteger, handling hex and octal notations.static java.lang.LongcreateLong(java.lang.String str)Deprecated.Convert aStringto aLong.static java.lang.NumbercreateNumber(java.lang.String str)Deprecated.Turns a string value into a java.lang.Number.static booleanisDigits(java.lang.String str)Deprecated.Checks whether theStringcontains only digit characters.static booleanisNumber(java.lang.String str)Deprecated.Checks whether the String a valid Java number.static bytemax(byte[] array)Deprecated.Returns the maximum value in an array.static bytemax(byte a, byte b, byte c)Deprecated.Gets the maximum of threebytevalues.static doublemax(double[] array)Deprecated.Returns the maximum value in an array.static doublemax(double a, double b, double c)Deprecated.Gets the maximum of threedoublevalues.static floatmax(float[] array)Deprecated.Returns the maximum value in an array.static floatmax(float a, float b, float c)Deprecated.Gets the maximum of threefloatvalues.static intmax(int[] array)Deprecated.Returns the maximum value in an array.static intmax(int a, int b, int c)Deprecated.Gets the maximum of threeintvalues.static longmax(long[] array)Deprecated.Returns the maximum value in an array.static longmax(long a, long b, long c)Deprecated.Gets the maximum of threelongvalues.static shortmax(short[] array)Deprecated.Returns the maximum value in an array.static shortmax(short a, short b, short c)Deprecated.Gets the maximum of threeshortvalues.static bytemin(byte[] array)Deprecated.Returns the minimum value in an array.static bytemin(byte a, byte b, byte c)Deprecated.Gets the minimum of threebytevalues.static doublemin(double[] array)Deprecated.Returns the minimum value in an array.static doublemin(double a, double b, double c)Deprecated.Gets the minimum of threedoublevalues.static floatmin(float[] array)Deprecated.Returns the minimum value in an array.static floatmin(float a, float b, float c)Deprecated.Gets the minimum of threefloatvalues.static intmin(int[] array)Deprecated.Returns the minimum value in an array.static intmin(int a, int b, int c)Deprecated.Gets the minimum of threeintvalues.static longmin(long[] array)Deprecated.Returns the minimum value in an array.static longmin(long a, long b, long c)Deprecated.Gets the minimum of threelongvalues.static shortmin(short[] array)Deprecated.Returns the minimum value in an array.static shortmin(short a, short b, short c)Deprecated.Gets the minimum of threeshortvalues.static intstringToInt(java.lang.String str)Deprecated.UsetoInt(String)This method will be removed in Commons Lang 3.0static intstringToInt(java.lang.String str, int defaultValue)Deprecated.UsetoInt(String, int)This method will be removed in Commons Lang 3.0static bytetoByte(java.lang.String str)Deprecated.Convert aStringto abyte, returningzeroif the conversion fails.static bytetoByte(java.lang.String str, byte defaultValue)Deprecated.Convert aStringto abyte, returning a default value if the conversion fails.static doubletoDouble(java.lang.String str)Deprecated.Convert aStringto adouble, returning0.0dif the conversion fails.static doubletoDouble(java.lang.String str, double defaultValue)Deprecated.Convert aStringto adouble, returning a default value if the conversion fails.static floattoFloat(java.lang.String str)Deprecated.Convert aStringto afloat, returning0.0fif the conversion fails.static floattoFloat(java.lang.String str, float defaultValue)Deprecated.Convert aStringto afloat, returning a default value if the conversion fails.static inttoInt(java.lang.String str)Deprecated.Convert aStringto anint, returningzeroif the conversion fails.static inttoInt(java.lang.String str, int defaultValue)Deprecated.Convert aStringto anint, returning a default value if the conversion fails.static longtoLong(java.lang.String str)Deprecated.Convert aStringto along, returningzeroif the conversion fails.static longtoLong(java.lang.String str, long defaultValue)Deprecated.Convert aStringto along, returning a default value if the conversion fails.static shorttoShort(java.lang.String str)Deprecated.Convert aStringto ashort, returningzeroif the conversion fails.static shorttoShort(java.lang.String str, short defaultValue)Deprecated.Convert aStringto anshort, returning a default value if the conversion fails. 
 - 
 
- 
- 
Field Detail
- 
LONG_ZERO
public static final java.lang.Long LONG_ZERO
Deprecated.Reusable Long constant for zero. 
- 
LONG_ONE
public static final java.lang.Long LONG_ONE
Deprecated.Reusable Long constant for one. 
- 
LONG_MINUS_ONE
public static final java.lang.Long LONG_MINUS_ONE
Deprecated.Reusable Long constant for minus one. 
- 
INTEGER_ZERO
public static final java.lang.Integer INTEGER_ZERO
Deprecated.Reusable Integer constant for zero. 
- 
INTEGER_ONE
public static final java.lang.Integer INTEGER_ONE
Deprecated.Reusable Integer constant for one. 
- 
INTEGER_MINUS_ONE
public static final java.lang.Integer INTEGER_MINUS_ONE
Deprecated.Reusable Integer constant for minus one. 
- 
SHORT_ZERO
public static final java.lang.Short SHORT_ZERO
Deprecated.Reusable Short constant for zero. 
- 
SHORT_ONE
public static final java.lang.Short SHORT_ONE
Deprecated.Reusable Short constant for one. 
- 
SHORT_MINUS_ONE
public static final java.lang.Short SHORT_MINUS_ONE
Deprecated.Reusable Short constant for minus one. 
- 
BYTE_ZERO
public static final java.lang.Byte BYTE_ZERO
Deprecated.Reusable Byte constant for zero. 
- 
BYTE_ONE
public static final java.lang.Byte BYTE_ONE
Deprecated.Reusable Byte constant for one. 
- 
BYTE_MINUS_ONE
public static final java.lang.Byte BYTE_MINUS_ONE
Deprecated.Reusable Byte constant for minus one. 
- 
DOUBLE_ZERO
public static final java.lang.Double DOUBLE_ZERO
Deprecated.Reusable Double constant for zero. 
- 
DOUBLE_ONE
public static final java.lang.Double DOUBLE_ONE
Deprecated.Reusable Double constant for one. 
- 
DOUBLE_MINUS_ONE
public static final java.lang.Double DOUBLE_MINUS_ONE
Deprecated.Reusable Double constant for minus one. 
- 
FLOAT_ZERO
public static final java.lang.Float FLOAT_ZERO
Deprecated.Reusable Float constant for zero. 
- 
FLOAT_ONE
public static final java.lang.Float FLOAT_ONE
Deprecated.Reusable Float constant for one. 
- 
FLOAT_MINUS_ONE
public static final java.lang.Float FLOAT_MINUS_ONE
Deprecated.Reusable Float constant for minus one. 
 - 
 
- 
Method Detail
- 
stringToInt
public static int stringToInt(java.lang.String str)
Deprecated.UsetoInt(String)This method will be removed in Commons Lang 3.0Convert a
Stringto anint, returningzeroif the conversion fails.If the string is
null,zerois returned.NumberUtils.stringToInt(null) = 0 NumberUtils.stringToInt("") = 0 NumberUtils.stringToInt("1") = 1- Parameters:
 str- the string to convert, may be null- Returns:
 - the int represented by the string, or 
zeroif conversion fails 
 
- 
toInt
public static int toInt(java.lang.String str)
Deprecated.Convert a
Stringto anint, returningzeroif the conversion fails.If the string is
null,zerois returned.NumberUtils.toInt(null) = 0 NumberUtils.toInt("") = 0 NumberUtils.toInt("1") = 1- Parameters:
 str- the string to convert, may be null- Returns:
 - the int represented by the string, or 
zeroif conversion fails - Since:
 - 2.1
 
 
- 
stringToInt
public static int stringToInt(java.lang.String str, int defaultValue)Deprecated.UsetoInt(String, int)This method will be removed in Commons Lang 3.0Convert a
Stringto anint, returning a default value if the conversion fails.If the string is
null, the default value is returned.NumberUtils.stringToInt(null, 1) = 1 NumberUtils.stringToInt("", 1) = 1 NumberUtils.stringToInt("1", 0) = 1- Parameters:
 str- the string to convert, may be nulldefaultValue- the default value- Returns:
 - the int represented by the string, or the default if conversion fails
 
 
- 
toInt
public static int toInt(java.lang.String str, int defaultValue)Deprecated.Convert a
Stringto anint, returning a default value if the conversion fails.If the string is
null, the default value is returned.NumberUtils.toInt(null, 1) = 1 NumberUtils.toInt("", 1) = 1 NumberUtils.toInt("1", 0) = 1- Parameters:
 str- the string to convert, may be nulldefaultValue- the default value- Returns:
 - the int represented by the string, or the default if conversion fails
 - Since:
 - 2.1
 
 
- 
toLong
public static long toLong(java.lang.String str)
Deprecated.Convert a
Stringto along, returningzeroif the conversion fails.If the string is
null,zerois returned.NumberUtils.toLong(null) = 0L NumberUtils.toLong("") = 0L NumberUtils.toLong("1") = 1L- Parameters:
 str- the string to convert, may be null- Returns:
 - the long represented by the string, or 
0if conversion fails - Since:
 - 2.1
 
 
- 
toLong
public static long toLong(java.lang.String str, long defaultValue)Deprecated.Convert a
Stringto along, returning a default value if the conversion fails.If the string is
null, the default value is returned.NumberUtils.toLong(null, 1L) = 1L NumberUtils.toLong("", 1L) = 1L NumberUtils.toLong("1", 0L) = 1L- Parameters:
 str- the string to convert, may be nulldefaultValue- the default value- Returns:
 - the long represented by the string, or the default if conversion fails
 - Since:
 - 2.1
 
 
- 
toFloat
public static float toFloat(java.lang.String str)
Deprecated.Convert a
Stringto afloat, returning0.0fif the conversion fails.If the string
strisnull,0.0fis returned.NumberUtils.toFloat(null) = 0.0f NumberUtils.toFloat("") = 0.0f NumberUtils.toFloat("1.5") = 1.5f- Parameters:
 str- the string to convert, may benull- Returns:
 - the float represented by the string, or 
0.0fif conversion fails - Since:
 - 2.1
 
 
- 
toFloat
public static float toFloat(java.lang.String str, float defaultValue)Deprecated.Convert a
Stringto afloat, returning a default value if the conversion fails.If the string
strisnull, the default value is returned.NumberUtils.toFloat(null, 1.1f) = 1.0f NumberUtils.toFloat("", 1.1f) = 1.1f NumberUtils.toFloat("1.5", 0.0f) = 1.5f- Parameters:
 str- the string to convert, may benulldefaultValue- the default value- Returns:
 - the float represented by the string, or defaultValue if conversion fails
 - Since:
 - 2.1
 
 
- 
toDouble
public static double toDouble(java.lang.String str)
Deprecated.Convert a
Stringto adouble, returning0.0dif the conversion fails.If the string
strisnull,0.0dis returned.NumberUtils.toDouble(null) = 0.0d NumberUtils.toDouble("") = 0.0d NumberUtils.toDouble("1.5") = 1.5d- Parameters:
 str- the string to convert, may benull- Returns:
 - the double represented by the string, or 
0.0dif conversion fails - Since:
 - 2.1
 
 
- 
toDouble
public static double toDouble(java.lang.String str, double defaultValue)Deprecated.Convert a
Stringto adouble, returning a default value if the conversion fails.If the string
strisnull, the default value is returned.NumberUtils.toDouble(null, 1.1d) = 1.1d NumberUtils.toDouble("", 1.1d) = 1.1d NumberUtils.toDouble("1.5", 0.0d) = 1.5d- Parameters:
 str- the string to convert, may benulldefaultValue- the default value- Returns:
 - the double represented by the string, or defaultValue if conversion fails
 - Since:
 - 2.1
 
 
- 
toByte
public static byte toByte(java.lang.String str)
Deprecated.Convert a
Stringto abyte, returningzeroif the conversion fails.If the string is
null,zerois returned.NumberUtils.toByte(null) = 0 NumberUtils.toByte("") = 0 NumberUtils.toByte("1") = 1- Parameters:
 str- the string to convert, may be null- Returns:
 - the byte represented by the string, or 
zeroif conversion fails - Since:
 - 2.5
 
 
- 
toByte
public static byte toByte(java.lang.String str, byte defaultValue)Deprecated.Convert a
Stringto abyte, returning a default value if the conversion fails.If the string is
null, the default value is returned.NumberUtils.toByte(null, 1) = 1 NumberUtils.toByte("", 1) = 1 NumberUtils.toByte("1", 0) = 1- Parameters:
 str- the string to convert, may be nulldefaultValue- the default value- Returns:
 - the byte represented by the string, or the default if conversion fails
 - Since:
 - 2.5
 
 
- 
toShort
public static short toShort(java.lang.String str)
Deprecated.Convert a
Stringto ashort, returningzeroif the conversion fails.If the string is
null,zerois returned.NumberUtils.toShort(null) = 0 NumberUtils.toShort("") = 0 NumberUtils.toShort("1") = 1- Parameters:
 str- the string to convert, may be null- Returns:
 - the short represented by the string, or 
zeroif conversion fails - Since:
 - 2.5
 
 
- 
toShort
public static short toShort(java.lang.String str, short defaultValue)Deprecated.Convert a
Stringto anshort, returning a default value if the conversion fails.If the string is
null, the default value is returned.NumberUtils.toShort(null, 1) = 1 NumberUtils.toShort("", 1) = 1 NumberUtils.toShort("1", 0) = 1- Parameters:
 str- the string to convert, may be nulldefaultValue- the default value- Returns:
 - the short represented by the string, or the default if conversion fails
 - Since:
 - 2.5
 
 
- 
createNumber
public static java.lang.Number createNumber(java.lang.String str) throws java.lang.NumberFormatExceptionDeprecated.Turns a string value into a java.lang.Number.
First, the value is examined for a type qualifier on the end (
'f','F','d','D','l','L'). If it is found, it starts trying to create successively larger types from the type specified until one is found that can represent the value.If a type specifier is not found, it will check for a decimal point and then try successively larger types from
IntegertoBigIntegerand fromFloattoBigDecimal.If the string starts with
0xor-0x, it will be interpreted as a hexadecimal integer. Values with leading0's will not be interpreted as octal.Returns
nullif the string isnull.This method does not trim the input string, i.e., strings with leading or trailing spaces will generate NumberFormatExceptions.
- Parameters:
 str- String containing a number, may be null- Returns:
 - Number created from the string
 - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
createFloat
public static java.lang.Float createFloat(java.lang.String str)
Deprecated.Convert a
Stringto aFloat.Returns
nullif the string isnull.- Parameters:
 str- aStringto convert, may be null- Returns:
 - converted 
Float - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
createDouble
public static java.lang.Double createDouble(java.lang.String str)
Deprecated.Convert a
Stringto aDouble.Returns
nullif the string isnull.- Parameters:
 str- aStringto convert, may be null- Returns:
 - converted 
Double - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
createInteger
public static java.lang.Integer createInteger(java.lang.String str)
Deprecated.Convert a
Stringto aInteger, handling hex and octal notations.Returns
nullif the string isnull.- Parameters:
 str- aStringto convert, may be null- Returns:
 - converted 
Integer - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
createLong
public static java.lang.Long createLong(java.lang.String str)
Deprecated.Convert a
Stringto aLong.Returns
nullif the string isnull.- Parameters:
 str- aStringto convert, may be null- Returns:
 - converted 
Long - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
createBigInteger
public static java.math.BigInteger createBigInteger(java.lang.String str)
Deprecated.Convert a
Stringto aBigInteger.Returns
nullif the string isnull.- Parameters:
 str- aStringto convert, may be null- Returns:
 - converted 
BigInteger - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
createBigDecimal
public static java.math.BigDecimal createBigDecimal(java.lang.String str)
Deprecated.Convert a
Stringto aBigDecimal.Returns
nullif the string isnull.- Parameters:
 str- aStringto convert, may be null- Returns:
 - converted 
BigDecimal - Throws:
 java.lang.NumberFormatException- if the value cannot be converted
 
- 
min
public static long min(long[] array)
Deprecated.Returns the minimum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
min
public static int min(int[] array)
Deprecated.Returns the minimum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
min
public static short min(short[] array)
Deprecated.Returns the minimum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
min
public static byte min(byte[] array)
Deprecated.Returns the minimum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
min
public static double min(double[] array)
Deprecated.Returns the minimum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty- See Also:
 IEEE754rUtils for a version of this method that handles NaN differently
 
- 
min
public static float min(float[] array)
Deprecated.Returns the minimum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty- See Also:
 IEEE754rUtils for a version of this method that handles NaN differently
 
- 
max
public static long max(long[] array)
Deprecated.Returns the maximum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
max
public static int max(int[] array)
Deprecated.Returns the maximum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
max
public static short max(short[] array)
Deprecated.Returns the maximum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
max
public static byte max(byte[] array)
Deprecated.Returns the maximum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty
 
- 
max
public static double max(double[] array)
Deprecated.Returns the maximum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty- See Also:
 IEEE754rUtils for a version of this method that handles NaN differently
 
- 
max
public static float max(float[] array)
Deprecated.Returns the maximum value in an array.
- Parameters:
 array- an array, must not be null or empty- Returns:
 - the minimum value in the array
 - Throws:
 java.lang.IllegalArgumentException- ifarrayisnulljava.lang.IllegalArgumentException- ifarrayis empty- See Also:
 IEEE754rUtils for a version of this method that handles NaN differently
 
- 
min
public static long min(long a, long b, long c)Deprecated.Gets the minimum of three
longvalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the smallest of the values
 
 
- 
min
public static int min(int a, int b, int c)Deprecated.Gets the minimum of three
intvalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the smallest of the values
 
 
- 
min
public static short min(short a, short b, short c)Deprecated.Gets the minimum of three
shortvalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the smallest of the values
 
 
- 
min
public static byte min(byte a, byte b, byte c)Deprecated.Gets the minimum of three
bytevalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the smallest of the values
 
 
- 
min
public static double min(double a, double b, double c)Deprecated.Gets the minimum of three
doublevalues.If any value is
NaN,NaNis returned. Infinity is handled.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the smallest of the values
 - See Also:
 for a version of this method that handles NaN differently
 
- 
min
public static float min(float a, float b, float c)Deprecated.Gets the minimum of three
floatvalues.If any value is
NaN,NaNis returned. Infinity is handled.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the smallest of the values
 - See Also:
 for a version of this method that handles NaN differently
 
- 
max
public static long max(long a, long b, long c)Deprecated.Gets the maximum of three
longvalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the largest of the values
 
 
- 
max
public static int max(int a, int b, int c)Deprecated.Gets the maximum of three
intvalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the largest of the values
 
 
- 
max
public static short max(short a, short b, short c)Deprecated.Gets the maximum of three
shortvalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the largest of the values
 
 
- 
max
public static byte max(byte a, byte b, byte c)Deprecated.Gets the maximum of three
bytevalues.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the largest of the values
 
 
- 
max
public static double max(double a, double b, double c)Deprecated.Gets the maximum of three
doublevalues.If any value is
NaN,NaNis returned. Infinity is handled.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the largest of the values
 - See Also:
 for a version of this method that handles NaN differently
 
- 
max
public static float max(float a, float b, float c)Deprecated.Gets the maximum of three
floatvalues.If any value is
NaN,NaNis returned. Infinity is handled.- Parameters:
 a- value 1b- value 2c- value 3- Returns:
 - the largest of the values
 - See Also:
 for a version of this method that handles NaN differently
 
- 
compare
public static int compare(double lhs, double rhs)Deprecated.Compares two
doublesfor order.This method is more comprehensive than the standard Java greater than, less than and equals operators.
- It returns 
-1if the first value is less than the second. - It returns 
+1if the first value is greater than the second. - It returns 
0if the values are equal. 
The ordering is as follows, largest to smallest:
- NaN
 - Positive infinity
 - Maximum double
 - Normal positive numbers
 - +0.0
 - -0.0
 - Normal negative numbers
 - Minimum double (
-Double.MAX_VALUE) - Negative infinity
 
Comparing
NaNwithNaNwill return0.- Parameters:
 lhs- the firstdoublerhs- the seconddouble- Returns:
 -1if lhs is less,+1if greater,0if equal to rhs
 - It returns 
 
- 
compare
public static int compare(float lhs, float rhs)Deprecated.Compares two floats for order.
This method is more comprehensive than the standard Java greater than, less than and equals operators.
- It returns 
-1if the first value is less than the second. - It returns 
+1if the first value is greater than the second. - It returns 
0if the values are equal. 
The ordering is as follows, largest to smallest:
- NaN
 - Positive infinity
 - Maximum float
 - Normal positive numbers
 - +0.0
 - -0.0
 - Normal negative numbers
 - Minimum float (
-Float.MAX_VALUE) - Negative infinity
 
Comparing
NaNwithNaNwill return0.- Parameters:
 lhs- the firstfloatrhs- the secondfloat- Returns:
 -1if lhs is less,+1if greater,0if equal to rhs
 - It returns 
 
- 
isDigits
public static boolean isDigits(java.lang.String str)
Deprecated.Checks whether the
Stringcontains only digit characters.Nulland empty String will returnfalse.- Parameters:
 str- theStringto check- Returns:
 trueif str contains only unicode numeric
 
- 
isNumber
public static boolean isNumber(java.lang.String str)
Deprecated.Checks whether the String a valid Java number.
Valid numbers include hexadecimal marked with the
0xqualifier, scientific notation and numbers marked with a type qualifier (e.g. 123L).Nulland empty String will returnfalse.- Parameters:
 str- theStringto check- Returns:
 trueif the string is a correctly formatted number
 
 - 
 
 -