public final class NumberParser
extends java.lang.Object
Constructor and Description |
---|
NumberParser()
Creates a new parser.
|
Modifier and Type | Method and Description |
---|---|
double |
parseDouble(java.lang.CharSequence s,
int start,
int end)
Parses a given block of text represented as a character sequence and
extracts a double value from it.
|
double |
parseDouble(java.lang.String s)
Parses a given block of text and extracts a double value from it.
|
int |
parseInt(java.lang.CharSequence s,
int start,
int end)
Parses a given block of text represented as a character sequence and
extracts an integer value from it.
|
int |
parseInt(java.lang.String s)
Parses a given block of text and extracts an integer value from it.
|
long |
parseLong(java.lang.CharSequence s,
int start,
int end)
Parses a given block of text represented as a character sequence and
extracts a long value from it.
|
long |
parseLong(java.lang.String s)
Parses a given block of text and extracts a long value from it.
|
public int parseInt(java.lang.String s) throws java.lang.NumberFormatException
s
- String to parse.java.lang.NumberFormatException
- If problem extracting integer from text.public int parseInt(java.lang.CharSequence s, int start, int end) throws java.lang.NumberFormatException
s
- Character sequence to parse.start
- Index of start of character sequence marking section to parse.end
- Index of end of character sequence marking section to parse.java.lang.NumberFormatException
- If problem extracting integer from character sequence.public long parseLong(java.lang.String s)
s
- String to parse.java.lang.NumberFormatException
- If problem extracting long from text.public long parseLong(java.lang.CharSequence s, int start, int end) throws java.lang.NumberFormatException
s
- Character sequence to parse.start
- Index of start of character sequence marking section to parse.end
- Index of end of character sequence marking section to parse.java.lang.NumberFormatException
- If problem extracting long from character sequence.public double parseDouble(java.lang.String s) throws java.lang.NumberFormatException
s
- String to parse.java.lang.NumberFormatException
- If problem extracting double from text.public double parseDouble(java.lang.CharSequence s, int start, int end) throws java.lang.NumberFormatException
s
- Character sequence to parse.start
- Index of start of character sequence marking section to parse.end
- Index of end of character sequence marking section to parse.java.lang.NumberFormatException
- If problem extracting double from character sequence.