Class ConfigurableDoubleParser

    • Constructor Detail

      • ConfigurableDoubleParser

        public ConfigurableDoubleParser​(NumberFormatSymbols symbols)
        Creates a new instance with the specified number format symbols.

        The parser does not ignore case.

        Parameters:
        symbols - the number format symbols
      • ConfigurableDoubleParser

        public ConfigurableDoubleParser​(java.text.DecimalFormatSymbols symbols)
        Creates a new instance with number format symbols derived from the specified symbols by calling NumberFormatSymbols.fromDecimalFormatSymbols(DecimalFormatSymbols).

        The parser does not ignore case.

        Parameters:
        symbols - the decimal format symbols
      • ConfigurableDoubleParser

        public ConfigurableDoubleParser​(NumberFormatSymbols symbols,
                                        boolean ignoreCase)
        Creates a new instance with the specified number format symbols and case sensitivity.
        Parameters:
        symbols - the number format symbols
        ignoreCase - whether case should be ignored by the parser
      • ConfigurableDoubleParser

        public ConfigurableDoubleParser​(java.text.DecimalFormatSymbols symbols,
                                        boolean ignoreCase)
        Creates a new instance with decimal format symbols and case sensitivity.

        The number format symbols are derived from the specified decimal format symbols by calling NumberFormatSymbols.fromDecimalFormatSymbols(DecimalFormatSymbols).

        Parameters:
        symbols - the decimal format symbols
        ignoreCase - whether case should be ignored by the parser
    • Method Detail

      • getNumberFormatSymbols

        public NumberFormatSymbols getNumberFormatSymbols()
        Gets the number format symbols of this parser.
        Returns:
        the number format symbols
      • isIgnoreCase

        public boolean isIgnoreCase()
        Returns true of this parser ignores case.
        Returns:
        true if case is ignored
      • parseDouble

        public double parseDouble​(java.lang.CharSequence str)
        Parses a double value from the specified char sequence.
        Parameters:
        str - a char sequence
        Returns:
        a double value
        Throws:
        java.lang.NumberFormatException - if the provided char sequence could not be parsed
      • parseDouble

        public double parseDouble​(java.lang.CharSequence str,
                                  int offset,
                                  int length)
        Parses a double value from a substring of the specified char sequence.
        Parameters:
        str - a char sequence
        offset - the start offset of the substring
        length - the length of the substring
        Throws:
        java.lang.NumberFormatException - if the provided char sequence could not be parsed
      • parseDouble

        public double parseDouble​(char[] str)
        Parses a double value from the specified char array.
        Parameters:
        str - a char array
        Returns:
        a double value
        Throws:
        java.lang.NumberFormatException - if the provided char array could not be parsed
      • parseDouble

        public double parseDouble​(char[] str,
                                  int offset,
                                  int length)
        Parses a double value from a substring of the specified char array.
        Parameters:
        str - a char array
        offset - the start offset of the substring
        length - the length of the substring
        Throws:
        java.lang.NumberFormatException - if the provided char array could not be parsed
      • parseDouble

        public double parseDouble​(byte[] str)
        Parses a double value from the specified byte array.
        Parameters:
        str - a byte array
        Returns:
        a double value
        Throws:
        java.lang.NumberFormatException - if the provided char array could not be parsed
      • parseDouble

        public double parseDouble​(byte[] str,
                                  int offset,
                                  int length)
        Parses a double value from a substring of the specified byte array.
        Parameters:
        str - a byte array
        offset - the start offset of the substring
        length - the length of the substring
        Throws:
        java.lang.NumberFormatException - if the provided char array could not be parsed