|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amx.duet.tools.text.NumericUtil
A utility class commonly used for safely converting String values to numeric values and numeric values to String values.
Constructor Summary | |
NumericUtil()
|
Method Summary | |
static boolean |
atob(java.lang.String value)
Converts a character representation to a boolean value |
static double |
atod(java.lang.String value)
Converts a character representation (with or without exponent) of a number to a 64-bit floating point value |
static float |
atof(java.lang.String value)
Converts a character representation (with or without exponent) of a number to a 32-bit floating point value |
static float |
ATOF(java.lang.String str)
Simulates the functionality of the NetLinx ATOF function. |
static int |
atoi(java.lang.String value)
Converts a character representation of a number to a 32-bit integer value |
static int |
ATOI(java.lang.String str)
Simulates the functionality of the NetLinx ATOI function. |
static long |
atol(java.lang.String value)
Converts a character representation of a number to a 64-bit long value |
static java.lang.String |
btoa(boolean value)
Converts a boolean value to an ASCII string. |
static java.lang.String |
dtoa(double value)
Converts a 64-bit floating-point value to an ASCII string containing the representation of the number |
static java.lang.String |
ftoa(float value)
Converts a 32-bit floating-point value to an ASCII string containing the representation of the number |
static boolean |
isNumeric(char cValue)
Check to see if the character passed in is a numeric value. |
static boolean |
isNumeric(java.lang.String sValue)
Check to see if the string passed in contains all numeric values. |
static java.lang.String |
itoa(int value)
Converts a 32-bit integer to an ASCII string. |
static java.lang.String |
ltoa(long value)
Converts a 64-bit long to an ASCII string. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NumericUtil()
Method Detail |
public static final boolean isNumeric(char cValue)
cValue
- character value to check.
public static final boolean isNumeric(java.lang.String sValue)
sValue
- String value to check.
public static int ATOI(java.lang.String str)
str
- - String containing an int value
public static float ATOF(java.lang.String str)
str
- - String containing a float value
public static final int atoi(java.lang.String value)
value
- String containing the character representation of the integer
atoi
returns the value representing
the first complete set of characters that represent an integer. Valid characters
are "0" through "9" as well as a prepended "-" representing a negative sign. If
invalid characters are found, zero is returned as a result.public static final long atol(java.lang.String value)
value
- String containing the character representation of the long
atol
returns the value representing
the first complete set of characters that represent a long. Valid characters
are "0" through "9" as well as a prepended "-" representing a negative sign.
If invalid characters are found, zero is returned as a result.public static final float atof(java.lang.String value)
value
- String containing the character representation of the floating point number.
atof
returns the value representing the first
complete set of characters that represents a floating point value. Valid characters are
"0" through "9" and "." along with the sign designators ("+" and "-") and the exponent
("e" or "E"). If invalid characters are found, zero is returned as a result.public static final double atod(java.lang.String value)
value
- String containing the character representation of the floating point number.
atod
returns the value representing the first
complete set of characters that represents a floating point value. Valid characters are
"0" through "9" and "." along with the sign designators ("+" and "-") and the exponent
("e" or "E"). If invalid characters are found, zero is returned as a result.public static final boolean atob(java.lang.String value)
value
- String containing the character representation of the boolean value.
true
or false
) representing the
converted string. atob
returns the value representing the first complete set
of characters that represent a boolean like value. Valid true characters are
"1" or "true" (case sensitive). Everything else is considered false.public static final java.lang.String itoa(int value)
value
- a 32-bit integer to convert to a string.
public static final java.lang.String ltoa(long value)
value
- a 64-bit long to convert to a string.
public static final java.lang.String ftoa(float value)
value
- a 32-bit floating-point number to convert to a string.
public static final java.lang.String dtoa(double value)
value
- a 64-bit floating-point number to convert to a string.
public static final java.lang.String btoa(boolean value)
value
- a boolean to convert to a string.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |