|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.ic.util.NumberUtils
public class NumberUtils
This class provides various number utilities via static methods.
| Constructor Summary | |
|---|---|
NumberUtils()
|
|
| Method Summary | |
|---|---|
static java.math.BigDecimal |
getBigDecimalNumber(java.lang.String number)
Converts the passed in string to a BigDecimal. |
static java.lang.Double |
getDoubleNumber(java.lang.String number)
Converts the passed in string to a double. |
static java.lang.Integer |
getIntegerNumber(java.lang.String number)
Converts the passed in string to an integer. |
static java.lang.Long |
getLongNumber(java.lang.String number)
Converts the passed in string to a long. |
static boolean |
isValidNumber(java.lang.Number number,
java.lang.Number lowRange,
java.lang.Number highRange)
Determines if a number is valid and is between a specified range. |
static boolean |
isValidNumber(java.lang.String number)
Determines if the passed in string value is a number. |
static boolean |
isValidNumber(java.lang.String number,
java.lang.Integer lowRange,
java.lang.Integer highRange)
Determines if a number is valid and is between a specified range. |
static void |
validateNumber(java.lang.Number number,
java.lang.Number lowRange,
java.lang.Number highRange)
Validates that a number if between a specified range, inclusive. |
static void |
validateNumber(java.lang.String number,
java.lang.Number lowRange,
java.lang.Number highRange)
Validates that a number (specified as a string) is between a specified range, inclusive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NumberUtils()
| Method Detail |
|---|
public static void validateNumber(java.lang.Number number,
java.lang.Number lowRange,
java.lang.Number highRange)
throws java.lang.IllegalArgumentException
number - The number to validate.lowRange - The low range for the number. If this parameter is null, no low range check will be performed.highRange - The high range for the number. If this parameters is null, no high range check will be
performed.
java.lang.IllegalArgumentException - if the number fails a validation.
public static void validateNumber(java.lang.String number,
java.lang.Number lowRange,
java.lang.Number highRange)
throws java.lang.IllegalArgumentException
number - The number to validate specified as a string.lowRange - The low range for the number. If this parameter is null, no low range check will be performed.highRange - The high range for the number. If this parameters is null, no high range check will be
performed.
java.lang.IllegalArgumentException - if the number fails a validation or if number isn't a valid number.
public static boolean isValidNumber(java.lang.Number number,
java.lang.Number lowRange,
java.lang.Number highRange)
number - The number to validate.lowRange - The low range for the number. If this parameter is null, no low range check will be performed.highRange - The high range for the number. If this parameters is null, no high range check will be
performed.
public static boolean isValidNumber(java.lang.String number,
java.lang.Integer lowRange,
java.lang.Integer highRange)
number - The number to validate specified as a string.lowRange - The low range for the number. If this parameter is null, no low range check will be performed.highRange - The high range for the number. If this parameters is null, no high range check will be
performed.
public static boolean isValidNumber(java.lang.String number)
number - The string to validate.
public static java.lang.Integer getIntegerNumber(java.lang.String number)
throws java.lang.IllegalArgumentException
number - The string to convert to a number.
java.lang.IllegalArgumentException - if the string isn't a valid number.
public static java.lang.Long getLongNumber(java.lang.String number)
throws java.lang.IllegalArgumentException
number - The string to convert to a number.
java.lang.IllegalArgumentException - if the string isn't a valid number.
public static java.lang.Double getDoubleNumber(java.lang.String number)
throws java.lang.IllegalArgumentException
number - The string to convert to a number.
java.lang.IllegalArgumentException - if the string isn't a valid number.
public static java.math.BigDecimal getBigDecimalNumber(java.lang.String number)
throws java.lang.IllegalArgumentException
number - The string to convert to a number.
java.lang.IllegalArgumentException - if the string isn't a valid number.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||