Java Utililty Methods Parse Int

List of utility methods to do Parse Int

Description

The list of methods to do Parse Int are organized into topic(s).

Method

longparseInt(char[] input, ParsePosition offset, int length)
parse Int
long result = 0;
int i;
while ((i = offset.getIndex()) < length) {
    char c = input[i];
    if (c >= '0' && c <= '9') {
        result = (result * 10) + (c - '0');
        offset.setIndex(i + 1);
    } else
...
intparseInt(char[] strs, int beginindex, int endindex)
parse Int
int result = 0;
int b = 1;
for (int i = endindex - 1; i >= beginindex; i--) {
    if (strs[i] < 48 || strs[i] > 57) {
        throw new ParseException("Parse error,can't parse char to int . ", 0);
    result = result + (strs[i] - 48) * b;
    b *= 10;
...
longparseInt(String src, Locale loc)
parse Int
if (loc == null) {
    loc = Locale.getDefault();
NumberFormat nf = NumberFormat.getNumberInstance(loc);
nf.setParseIntegerOnly(true);
return nf.parse(src).longValue();
intparseInt(String stringValue)
parse Int
return parseNumber(stringValue).intValue();
intparseInt(String value)
Parse a string containing an integer with locale specific formatting.
return Integer.parseInt(parsePrepare(value));
longparseInteger(PushbackReader reader)
parse Integer
boolean negative = parseOptionalSign(reader);
return parseNonNegativeInteger(reader) * (negative ? -1 : 1);
IntegerparseInteger(String text)
Returns text converted to an integer value or throws an exception.
int def = 0;
if (text == null)
    return def;
def = nf.parse(text).intValue();
return def;