Class JavaDoubleBitsFromCharArray
java.lang.Object
ch.randelshofer.fastdoubleparser.AbstractNumberParser
ch.randelshofer.fastdoubleparser.AbstractFloatValueParser
ch.randelshofer.fastdoubleparser.AbstractJavaFloatingPointBitsFromCharArray
ch.randelshofer.fastdoubleparser.JavaDoubleBitsFromCharArray
Parses a
double from a char array.-
Field Summary
Fields inherited from class AbstractFloatValueParser
MAX_EXPONENT_NUMBER, MAX_INPUT_LENGTH, MINIMAL_NINETEEN_DIGIT_INTEGERFields inherited from class AbstractNumberParser
CHAR_TO_HEX_MAP, DECIMAL_POINT_CLASS, ILLEGAL_OFFSET_OR_ILLEGAL_LENGTH, OTHER_CLASS, SYNTAX_ERROR, SYNTAX_ERROR_BITS, VALUE_EXCEEDS_LIMITS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) longnan()(package private) long(package private) long(package private) longvalueOfFloatLiteral(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.(package private) longvalueOfHexLiteral(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.Methods inherited from class AbstractJavaFloatingPointBitsFromCharArray
parseFloatingPointLiteralMethods inherited from class AbstractNumberParser
charAt, charAt, charAt, checkBounds, checkBounds, lookupHex, lookupHex
-
Constructor Details
-
JavaDoubleBitsFromCharArray
public JavaDoubleBitsFromCharArray()Creates a new instance.
-
-
Method Details
-
nan
long nan()- Specified by:
nanin classAbstractJavaFloatingPointBitsFromCharArray- Returns:
- a NaN constant in the specialized type wrapped in a
long
-
negativeInfinity
long negativeInfinity()- Specified by:
negativeInfinityin classAbstractJavaFloatingPointBitsFromCharArray- Returns:
- a negative infinity constant in the specialized type wrapped in a
long
-
positiveInfinity
long positiveInfinity()- Specified by:
positiveInfinityin classAbstractJavaFloatingPointBitsFromCharArray- Returns:
- a positive infinity constant in the specialized type wrapped in a
long
-
valueOfFloatLiteral
long valueOfFloatLiteral(char[] str, int startIndex, int endIndex, boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand) Description copied from class:AbstractJavaFloatingPointBitsFromCharArrayComputes a float value from the given components of a decimal float literal.- Specified by:
valueOfFloatLiteralin classAbstractJavaFloatingPointBitsFromCharArray- Parameters:
str- the string that contains the float literal (and maybe more)startIndex- the start index (inclusive) of the float literal inside the stringendIndex- the end index (exclusive) of the float literal inside the stringisNegative- whether the float value is negativesignificand- the significand of the float value (can be truncated)exponent- the exponent of the float valueisSignificandTruncated- whether the significand is truncatedexponentOfTruncatedSignificand- the exponent value of the truncated significand- Returns:
- the bit pattern of the parsed value, if the input is legal;
otherwise,
-1L.
-
valueOfHexLiteral
long valueOfHexLiteral(char[] str, int startIndex, int endIndex, boolean isNegative, long significand, int exponent, boolean isSignificandTruncated, int exponentOfTruncatedSignificand) Description copied from class:AbstractJavaFloatingPointBitsFromCharArrayComputes a float value from the given components of a hexadecimal float literal.- Specified by:
valueOfHexLiteralin classAbstractJavaFloatingPointBitsFromCharArray- Parameters:
str- the string that contains the float literal (and maybe more)startIndex- the start index (inclusive) of the float literal inside the stringendIndex- the end index (exclusive) of the float literal inside the stringisNegative- whether the float value is negativesignificand- the significand of the float value (can be truncated)exponent- the exponent of the float valueisSignificandTruncated- whether the significand is truncatedexponentOfTruncatedSignificand- the exponent value of the truncated significand- Returns:
- the bit pattern of the parsed value, if the input is legal;
otherwise,
-1L.
-