Java Utililty Methods Parse Int

List of utility methods to do Parse Int

  1. HOME
  2. Java
  3. P
  4. Parse Int

Description

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

Method

long parseInt(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
...
int parseInt(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;
...
long parseInt(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();
int parseInt(String stringValue)
parse Int
return parseNumber(stringValue).intValue();
int parseInt(String value)
Parse a string containing an integer with locale specific formatting.
return Integer.parseInt(parsePrepare(value));
long parseInteger(PushbackReader reader)
parse Integer
boolean negative = parseOptionalSign(reader);
return parseNonNegativeInteger(reader) * (negative ? -1 : 1);
Integer parseInteger(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;


AltStyle によって変換されたページ (->オリジナル) /