Note
Does NOT validate against maximum length limits: caller must do that if and as necessary.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | L_BILLION
Constants needed for parsing longs from basic int parsing methods |
| pack-priv static final String | |
| pack-priv static final String | |
| public static final String | NASTY_SMALL_DOUBLE
Formerly used constant for a value that was problematic on certain pre-1.8 JDKs. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: True if specified String representation is within Java
long range; false if not.Buffer that contains long value to check ch, int Offset of the first digit character in buffer off, int Length of the number to decode (in characters) len, boolean Whether original number had a minus sign (which is
NOT passed to this method) or not negative)Helper method for determining if given String representation of an integral number would fit in 64-bit Java long or not. |
| public static boolean | Returns: True if specified String representation is within Java
long range; false if not.String that contains s, boolean long value to checkWhether original number had a minus sign (which is
NOT passed to this method) or not negative)Similar to |
| public static double | Returns: closest matching double (or `def` if there is an issue with `s`) where useFastParser=falsea string representing a number to parse s, final double the default to return if `s` is not a parseable number def)
|
| public static double | Returns: closest matching double (or `def` if there is an issue with `s`)a string representing a number to parse s, final double the default to return if `s` is not a parseable number def, final boolean whether to use useFastParser)FastDoubleParser
|
| public static int | |
| public static long | |
| public static BigDecimal | |
| public static BigDecimal | Returns: a BigDecimala string representing a number to parse s, final boolean whether to use custom fast parser (true) or JDK default (false) parser useFastParser)
|
| public static BigDecimal | Returns: a BigDecimala char array with text that makes up a number ch, final int the offset to apply when parsing the number in the char array off, final int the length of the number in the char array len)
|
| public static BigDecimal | Returns: a BigDecimala char array with text that makes up a number ch, final int the offset to apply when parsing the number in the char array off, final int the length of the number in the char array len, final boolean whether to use custom fast parser (true) or JDK default (false) parser useFastParser)
|
| public static BigDecimal | |
| public static BigDecimal | Returns: a BigDecimala char array with text that makes up a number ch, final boolean whether to use custom fast parser (true) or JDK default (false) parser useFastParser)
|
| public static BigInteger | |
| public static BigInteger | Returns: a BigIntegera string representing a number to parse s, final boolean whether to use custom fast parser (true) or JDK default (false) parser useFastParser)
|
| public static BigInteger | Returns: a BigIntegera string representing a number to parse s, final int for parse radix, final boolean whether to use custom fast parser (true) or JDK default (false) parser useFastParser)
|
| public static double | |
| public static double | Returns: closest matching doublea string representing a number to parse s, final boolean whether to use useFastParser)FastDoubleParser
|
| public static float | |
| public static float | Returns: closest matching floata string representing a number to parse s, final boolean whether to use useFastParser)FastDoubleParser
|
| public static int | Returns: Decodedint valueBuffer that contains integer value to decode ch, int Offset of the first digit character in buffer off, int Length of the number to decode (in characters) len)Fast method for parsing unsigned integers that are known to fit into regular 32-bit signed int type. |
| public static int | |
| public static long | |
| public static long | Returns: Decodedlong valueString that contains s)long value to decodeSimilar to |
| public static long | Returns: Decodedlong valueBuffer that contains integer value to decode ch, int Offset of the first digit character in buffer off, boolean Whether original number had a minus sign negative)Parses an unsigned long made up of exactly 19 digits. |
| L_BILLION | back to summary |
|---|---|
| pack-priv static final long L_BILLION Constants needed for parsing longs from basic int parsing methods | |
| MAX_LONG_STR | back to summary |
|---|---|
| pack-priv static final String MAX_LONG_STR | |
| MIN_LONG_STR_NO_SIGN | back to summary |
|---|---|
| pack-priv static final String MIN_LONG_STR_NO_SIGN | |
| NASTY_SMALL_DOUBLE | back to summary |
|---|---|
| public static final String NASTY_SMALL_DOUBLE
Deprecated Since 2.14 -- do not use Formerly used constant for a value that was problematic on certain pre-1.8 JDKs. | |
| NumberInput | back to summary |
|---|---|
| public NumberInput() | |
| inLongRange | back to summary |
|---|---|
| public static boolean inLongRange(char[] ch, int off, int len, boolean negative) Helper method for determining if given String representation of an integral number would fit in 64-bit Java long or not. Note that input String must NOT contain leading minus sign (even if 'negative' is set to true).
| |
| inLongRange | back to summary |
|---|---|
| public static boolean inLongRange(String s, boolean negative) Similar to
| |
| parseAsDouble | back to summary |
|---|---|
public static double parseAsDouble(final String s, final double def)
| |
| parseAsDouble | back to summary |
|---|---|
public static double parseAsDouble(String s, final double def, final boolean useFastParser)
| |
| parseAsInt | back to summary |
|---|---|
| public static int parseAsInt(String s, int def) | |
| parseAsLong | back to summary |
|---|---|
| public static long parseAsLong(String s, long def) | |
| parseBigDecimal | back to summary |
|---|---|
public static BigDecimal parseBigDecimal(final String s) throws NumberFormatException
| |
| parseBigDecimal | back to summary |
|---|---|
public static BigDecimal parseBigDecimal(final String s, final boolean useFastParser) throws NumberFormatException
| |
| parseBigDecimal | back to summary |
|---|---|
public static BigDecimal parseBigDecimal(final char[] ch, final int off, final int len) throws NumberFormatException
| |
| parseBigDecimal | back to summary |
|---|---|
public static BigDecimal parseBigDecimal(final char[] ch, final int off, final int len, final boolean useFastParser) throws NumberFormatException
| |
| parseBigDecimal | back to summary |
|---|---|
public static BigDecimal parseBigDecimal(final char[] ch) throws NumberFormatException
| |
| parseBigDecimal | back to summary |
|---|---|
public static BigDecimal parseBigDecimal(final char[] ch, final boolean useFastParser) throws NumberFormatException
| |
| parseBigInteger | back to summary |
|---|---|
public static BigInteger parseBigInteger(final String s) throws NumberFormatException
| |
| parseBigInteger | back to summary |
|---|---|
public static BigInteger parseBigInteger(final String s, final boolean useFastParser) throws NumberFormatException
| |
| parseBigIntegerWithRadix | back to summary |
|---|---|
public static BigInteger parseBigIntegerWithRadix(final String s, final int radix, final boolean useFastParser) throws NumberFormatException
| |
| parseDouble | back to summary |
|---|---|
public static double parseDouble(final String s) throws NumberFormatException
| |
| parseDouble | back to summary |
|---|---|
public static double parseDouble(final String s, final boolean useFastParser) throws NumberFormatException
| |
| parseFloat | back to summary |
|---|---|
public static float parseFloat(final String s) throws NumberFormatException
| |
| parseFloat | back to summary |
|---|---|
public static float parseFloat(final String s, final boolean useFastParser) throws NumberFormatException
| |
| parseInt | back to summary |
|---|---|
| public static int parseInt(char[] ch, int off, int len) Fast method for parsing unsigned integers that are known to fit into regular 32-bit signed int type. This means that length is between 1 and 9 digits (inclusive) and there is no sign character. Note public to let unit tests call it; not meant to be used by any code outside this package.
| |
| parseInt | back to summary |
|---|---|
| public static int parseInt(String s) Helper method to (more) efficiently parse integer numbers from
String values. Input String must be simple Java integer value.
No range checks are made to verify that the value fits in 32-bit Java Note semantics differ significantly from
| |
| parseLong | back to summary |
|---|---|
| public static long parseLong(char[] ch, int off, int len) | |
| parseLong | back to summary |
|---|---|
| public static long parseLong(String s) Similar to
| |
| parseLong19 | back to summary |
|---|---|
| public static long parseLong19(char[] ch, int off, boolean negative) Parses an unsigned long made up of exactly 19 digits.
It is the callers responsibility to make sure the input is exactly 19 digits.
and fits into a 64bit long by calling
Note that input String must NOT contain leading minus sign (even
if
| |