FloatingPointLiteral from a char array.
This class should have a type parameter for the return value of its parse
methods. Unfortunately Java does not support type parameters for primitive
types. As a workaround we use long. A long has enough bits to
fit a double value or a float value.
See JavaDoubleParser for the grammar of FloatingPointLiteral.
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract long | |
| pack-priv abstract long | |
| private long | Returns: the bit pattern of the parsed value, if the input is legal; otherwise,-1L.a string str, int the current index index, int start index inclusive of the startIndex, int DecimalFloatingPointLiteralWithWhiteSpaceend index (exclusive) endIndex, boolean true if the float value is negative isNegative, boolean true if we have consumed the optional leading zero hasLeadingZero)Parses a |
| public long | Returns: the bit pattern of the parsed value, if the input is legal; otherwise,-1L.a string containing a str, int FloatingPointLiteralWithWhiteSpacestart offset of offset, int FloatingPointLiteralWithWhiteSpace in strlength of length)FloatingPointLiteralWithWhiteSpace in strParses a |
| private long | Returns: the bit pattern of the parsed value, if the input is legal; otherwise,-1L.the input string str, int index to the first character of RestOfHexFloatingPointLiteral index, int the start index of the string startIndex, int the end index of the string endIndex, boolean if the resulting number is negative isNegative)Parses the following rules
(more rules are defined in
|
| private long | |
| pack-priv abstract long | |
| private static int | Returns: index after the optional white spacea string str, int start index (inclusive) of the optional white space index, int end index (exclusive) of the optional white space endIndex)Skips optional white space in the provided string |
| private long | |
| pack-priv abstract long | Returns: the bit pattern of the parsed value, if the input is legal; otherwise,-1L.the string that contains the float literal (and maybe more) str, int the start index (inclusive) of the float literal
inside the string startIndex, int the end index (exclusive) of the float literal inside
the string endIndex, boolean whether the float value is negative isNegative, long the significand of the float value (can be truncated) significand, int the exponent of the float value exponent, boolean whether the significand is truncated isSignificandTruncated, int the exponent value of the truncated
significand exponentOfTruncatedSignificand)Computes a float value from the given components of a decimal float literal. |
| pack-priv abstract long | Returns: the bit pattern of the parsed value, if the input is legal; otherwise,-1L.the string that contains the float literal (and maybe more) str, int the start index (inclusive) of the float literal
inside the string startIndex, int the end index (exclusive) of the float literal inside
the string endIndex, boolean whether the float value is negative isNegative, long the significand of the float value (can be truncated) significand, int the exponent of the float value exponent, boolean whether the significand is truncated isSignificandTruncated, int the exponent value of the truncated
significand exponentOfTruncatedSignificand)Computes a float value from the given components of a hexadecimal float literal. |
| CONDITIONAL_COMPILATION_PARSE_EIGHT_HEX_DIGITS | back to summary |
|---|---|
| private static final boolean CONDITIONAL_COMPILATION_PARSE_EIGHT_HEX_DIGITS | |
| AbstractJavaFloatingPointBitsFromCharArray | back to summary |
|---|---|
| pack-priv AbstractJavaFloatingPointBitsFromCharArray() | |
| nan | back to summary |
|---|---|
pack-priv abstract long nan()
| |
| negativeInfinity | back to summary |
|---|---|
pack-priv abstract long negativeInfinity()
| |
| parseDecFloatLiteral | back to summary |
|---|---|
| private long parseDecFloatLiteral(char[] str, int index, int startIndex, int endIndex, boolean isNegative, boolean hasLeadingZero) Parses a See JavaDoubleParser for the grammar of
DecimalFloatingPointLiteral and DecSignificand.
| |
| parseFloatingPointLiteral | back to summary |
|---|---|
| public long parseFloatingPointLiteral(char[] str, int offset, int length) Parses a See JavaDoubleParser for the grammar of
FloatingPointLiteral.
| |
| parseHexFloatLiteral | back to summary |
|---|---|
| private long parseHexFloatLiteral(char[] str, int index, int startIndex, int endIndex, boolean isNegative) Parses the following rules
(more rules are defined in
| |
| parseNaNOrInfinity | back to summary |
|---|---|
| private long parseNaNOrInfinity(char[] str, int index, int endIndex, boolean isNegative) | |
| positiveInfinity | back to summary |
|---|---|
pack-priv abstract long positiveInfinity()
| |
| skipWhitespace | back to summary |
|---|---|
| private static int skipWhitespace(char[] str, int index, int endIndex) Skips optional white space in the provided string
| |
| tryToParseEightHexDigits | back to summary |
|---|---|
| private long tryToParseEightHexDigits(char[] str, int offset) | |
| valueOfFloatLiteral | back to summary |
|---|---|
| pack-priv abstract long valueOfFloatLiteral(char[] str, int startIndex, int endIndex, boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand) Computes a float value from the given components of a decimal float literal.
| |
| valueOfHexLiteral | back to summary |
|---|---|
| pack-priv abstract long valueOfHexLiteral(char[] str, int startIndex, int endIndex, boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand) Computes a float value from the given components of a hexadecimal float literal.
| |