Class AbstractConfigurableFloatingPointBitsFromCharArray

    • Field Detail

      • minusSign

        private final CharSet minusSign
      • plusSign

        private final CharSet plusSign
      • decimalSeparator

        private final CharSet decimalSeparator
      • groupingSeparator

        private final CharSet groupingSeparator
      • infinity

        private final CharTrie infinity
      • exponentSeparator

        private final CharTrie exponentSeparator
      • formatChar

        private final CharSet formatChar
    • Constructor Detail

      • AbstractConfigurableFloatingPointBitsFromCharArray

        public AbstractConfigurableFloatingPointBitsFromCharArray​(NumberFormatSymbols symbols,
                                                                  boolean ignoreCase)
    • Method Detail

      • nan

        abstract long nan()
        Returns:
        a NaN constant in the specialized type wrapped in a long
      • negativeInfinity

        abstract long negativeInfinity()
        Returns:
        a negative infinity constant in the specialized type wrapped in a long
      • parseFloatingPointLiteral

        public final long parseFloatingPointLiteral​(char[] str,
                                                    int offset,
                                                    int length)
        Parses a FloatingPointLiteral production with optional leading and trailing white space.
        FloatingPointLiteralWithWhiteSpace:
        [WhiteSpace] FloatingPointLiteral [WhiteSpace]
        See JavaDoubleParser for the grammar of FloatingPointLiteral.
        Parameters:
        str - a string containing a FloatingPointLiteralWithWhiteSpace
        offset - start offset of FloatingPointLiteralWithWhiteSpace in str
        length - length of FloatingPointLiteralWithWhiteSpace in str
        Returns:
        the bit pattern of the parsed value, if the input is legal; otherwise, -1L.
      • skipFormatCharacters

        private int skipFormatCharacters​(char[] str,
                                         int index,
                                         int endIndex)
        Skips all format characters.
        Parameters:
        str - a char array that contains a string
        index - start index (inclusive) of the string
        endIndex - end index (exclusive) of the string
        Returns:
        index after the optional format character
      • parseNaNOrInfinity

        private long parseNaNOrInfinity​(char[] str,
                                        int index,
                                        int endIndex,
                                        boolean isNegative,
                                        boolean isSignificandSigned)
      • positiveInfinity

        abstract long positiveInfinity()
        Returns:
        a positive infinity constant in the specialized type wrapped in a long
      • valueOfFloatLiteral

        abstract long valueOfFloatLiteral​(char[] str,
                                          int integerStartIndex,
                                          int integerEndIndex,
                                          int fractionStartIndex,
                                          int fractionEndIndex,
                                          boolean isSignificandNegative,
                                          long significand,
                                          int exponent,
                                          boolean isSignificandTruncated,
                                          int exponentOfTruncatedSignificand,
                                          int exponentValue,
                                          int startIndex,
                                          int endIndex)
        Computes a float value from the given components of a decimal float literal.
        Parameters:
        str - the string that contains the float literal (and maybe more)
        integerStartIndex - the start index (inclusive) of the integer part of the significand inside the string
        integerEndIndex - the end index (exclusive) of the integer part of the significand the string
        fractionStartIndex - the start index (inclusive) of the fraction part of the significand inside the string
        fractionEndIndex - the end index (exclusive) of the fraction part of the significand the string
        isSignificandNegative - whether the significand value is negative
        significand - the significand of the float value (can be truncated)
        exponent - the exponent of the float value considering the significand
        isSignificandTruncated - whether the significand is truncated
        exponentOfTruncatedSignificand - the exponent value of the truncated significand
        exponentValue - the exponent of the float value without considering the significand
        startIndex - the start index of the literal in str
        endIndex - the end index of the literal in str
        Returns:
        the bit pattern of the parsed value, if the input is legal; otherwise, -1L.
      • slowPathToDouble

        protected double slowPathToDouble​(char[] str,
                                          int integerStartIndex,
                                          int integerEndIndex,
                                          int fractionStartIndex,
                                          int fractionEndIndex,
                                          boolean isSignificandNegative,
                                          int exponentValue)