Class NumberParserImpl
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.number.parse.NumberParserImpl
Primary number parsing implementation class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMatcher(NumberParseMatcher matcher) voidaddMatchers(Collection<? extends NumberParseMatcher> matchers) static NumberParserImplstatic NumberParserImplcreateParserFromProperties(DecimalFormatProperties properties, DecimalFormatSymbols symbols, boolean parseCurrency) Creates a parser from the given DecimalFormatProperties.static NumberParserImplcreateSimpleParser(ULocale locale, String pattern, int parseFlags) Creates a parser with most default options.voidfreeze()intvoidparse(String input, boolean greedy, ParsedNumber result) voidparse(String input, int start, boolean greedy, ParsedNumber result) Primary entrypoint to parsing code path.static NumberparseStatic(String input, ParsePosition ppos, DecimalFormatProperties properties, DecimalFormatSymbols symbols) Parses the string without returning a NumberParserImpl.static CurrencyAmountparseStaticCurrency(String input, ParsePosition ppos, DecimalFormatProperties properties, DecimalFormatSymbols symbols) Parses the string without returning a NumberParserImpl.toString()
-
Constructor Details
-
NumberParserImpl
public NumberParserImpl(int parseFlags) Creates a new, empty parser.- Parameters:
parseFlags- The parser settings defined in the PARSE_FLAG_* fields.
-
-
Method Details
-
createSimpleParser
Creates a parser with most default options. Used for testing, not production. -
parseStatic
public static Number parseStatic(String input, ParsePosition ppos, DecimalFormatProperties properties, DecimalFormatSymbols symbols) Parses the string without returning a NumberParserImpl. Used for testing, not production. -
parseStaticCurrency
public static CurrencyAmount parseStaticCurrency(String input, ParsePosition ppos, DecimalFormatProperties properties, DecimalFormatSymbols symbols) Parses the string without returning a NumberParserImpl. Used for testing, not production. -
createDefaultParserForLocale
-
createParserFromProperties
public static NumberParserImpl createParserFromProperties(DecimalFormatProperties properties, DecimalFormatSymbols symbols, boolean parseCurrency) Creates a parser from the given DecimalFormatProperties. This is the endpoint used by DecimalFormat in production code.- Parameters:
properties- The property bag.symbols- The locale's symbols.parseCurrency- True to force a currency match and use monetary separators; false otherwise.- Returns:
- An immutable parser object.
-
addMatcher
-
addMatchers
-
freeze
public void freeze() -
getParseFlags
public int getParseFlags() -
parse
-
parse
Primary entrypoint to parsing code path.- Parameters:
input- The string to parse. This is a String, not CharSequence, to enforce assumptions about immutability (CharSequences are not guaranteed to be immutable).start- The index into the string at which to start parsing.greedy- Whether to use the faster but potentially less accurate greedy code path.result- Output variable to store results.
-
toString
-