|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcds.util.Conv
Class containing static methods for some particular conversions
Some comments:
The methods converting strings to intorlong are faster that the regular
Java classes (Integer.parseInt() or Long.parseLong())
| Constructor Summary | |
Conv()
|
|
| Method Summary | |
static int |
str2int(java.lang.String str)
Converts a String into an integer. |
static int |
str2int(java.lang.String str,
int begin,
int end)
Converts a subset of a String into an integer The substring must contain only digits, and can begin with a + ou - sign. |
static long |
str2long(java.lang.String str)
Converts a String into an long The string must contain only digits, and can begin with a + ou - sign. |
static long |
str2long(java.lang.String str,
int begin,
int end)
Converts a subset of a String into an long The substring must contain only digits, and can begin with a + ou - sign. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Conv()
| Method Detail |
public static final int str2int(java.lang.String str)
str - String to convert
public static int str2int(java.lang.String str,
int begin,
int end)
str - String to convertbegin - first character to use in the String (counted from 0)end - first char after the number (= first char not to use)
java.lang.NumberFormatException - if the string contains non digit characterspublic static final long str2long(java.lang.String str)
str - String to convert
java.lang.NumberFormatException - if the string contains non digit characters
public static final long str2long(java.lang.String str,
int begin,
int end)
str - String to convertbegin - first character to use in the String (counted from 0)end - first char after the number (= first char not to use)
java.lang.NumberFormatException - if the string contains non digit characters
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||