public final class ParseUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.NumberFormatException |
EMPTY_STRING
Preallocated exceptions.
|
static java.lang.NumberFormatException |
EXPONENT_OVERFLOW
Preallocated exceptions.
|
private static int |
INFINITY_LENGTH
Length of pattern
|
private static char[] |
INFINITY_PATTERN
Infinity pattern, with any capitalization
|
static java.lang.NumberFormatException |
INVALID_EXPONENT
Preallocated exceptions.
|
static java.lang.NumberFormatException |
NOT_A_NUMBER
Preallocated exceptions.
|
static java.lang.NumberFormatException |
PRECISION_OVERFLOW
Preallocated exceptions.
|
static java.lang.NumberFormatException |
TRAILING_CHARACTERS
Preallocated exceptions.
|
Modifier | Constructor and Description |
---|---|
private |
ParseUtil()
Private constructor.
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
matchInf(byte[] str,
byte firstchar,
int start,
int end)
Match "inf", "infinity" in a number of different capitalizations.
|
private static boolean |
matchInf(java.lang.CharSequence str,
char firstchar,
int start,
int end)
Match "inf", "infinity" in a number of different capitalizations.
|
private static boolean |
matchNaN(byte[] str,
byte firstchar,
int start,
int end)
Match "NaN" in a number of different capitalizations.
|
private static boolean |
matchNaN(java.lang.CharSequence str,
char firstchar,
int start,
int end)
Match "NaN" in a number of different capitalizations.
|
static double |
parseDouble(byte[] str,
int start,
int end)
Parse a double from a character sequence.
|
static double |
parseDouble(java.lang.CharSequence str)
Parse a double from a character sequence.
|
static double |
parseDouble(java.lang.CharSequence str,
int start,
int end)
Parse a double from a character sequence.
|
static int |
parseIntBase10(java.lang.CharSequence str)
Parse an integer from a character sequence.
|
static int |
parseIntBase10(java.lang.CharSequence str,
int start,
int end)
Parse an integer from a character sequence.
|
static long |
parseLongBase10(java.lang.CharSequence str)
Parse a long integer from a character sequence.
|
static long |
parseLongBase10(java.lang.CharSequence str,
int start,
int end)
Parse a long integer from a character sequence.
|
public static final java.lang.NumberFormatException EMPTY_STRING
public static final java.lang.NumberFormatException EXPONENT_OVERFLOW
public static final java.lang.NumberFormatException INVALID_EXPONENT
public static final java.lang.NumberFormatException TRAILING_CHARACTERS
public static final java.lang.NumberFormatException PRECISION_OVERFLOW
public static final java.lang.NumberFormatException NOT_A_NUMBER
private static final char[] INFINITY_PATTERN
private static final int INFINITY_LENGTH
public static double parseDouble(byte[] str, int start, int end)
Double.parseDouble(java.lang.String)
, this will not
create an object and thus is expected to put less load on the garbage
collector. It will accept some more spellings of NaN and infinity, thus
removing the need for checking for these independently.str
- Stringstart
- Beginend
- Endpublic static double parseDouble(java.lang.CharSequence str)
Double.parseDouble(java.lang.String)
, this will not
create an object and thus is expected to put less load on the garbage
collector. It will accept some more spellings of NaN and infinity, thus
removing the need for checking for these independently.str
- Stringpublic static double parseDouble(java.lang.CharSequence str, int start, int end)
Double.parseDouble(java.lang.String)
, this will not
create an object and thus is expected to put less load on the garbage
collector. It will accept some more spellings of NaN and infinity, thus
removing the need for checking for these independently.str
- Stringstart
- Beginend
- Endpublic static long parseLongBase10(java.lang.CharSequence str)
str
- Stringpublic static long parseLongBase10(java.lang.CharSequence str, int start, int end)
str
- Stringstart
- Beginend
- Endpublic static int parseIntBase10(java.lang.CharSequence str)
str
- Stringpublic static int parseIntBase10(java.lang.CharSequence str, int start, int end)
str
- Stringstart
- Beginend
- Endprivate static boolean matchInf(byte[] str, byte firstchar, int start, int end)
str
- String to matchfirstchar
- First characterstart
- Interval beginend
- Interval endtrue
when infinity was recognized.private static boolean matchInf(java.lang.CharSequence str, char firstchar, int start, int end)
str
- String to matchfirstchar
- First characterstart
- Interval beginend
- Interval endtrue
when infinity was recognized.private static boolean matchNaN(byte[] str, byte firstchar, int start, int end)
str
- String to matchfirstchar
- First characterstart
- Interval beginend
- Interval endtrue
when NaN was recognized.private static boolean matchNaN(java.lang.CharSequence str, char firstchar, int start, int end)
str
- String to matchfirstchar
- First characterstart
- Interval beginend
- Interval endtrue
when NaN was recognized.Copyright © 2019 ELKI Development Team. License information.