Class NumberFunctionFactory

java.lang.Object
com.ibm.icu.message2.NumberFunctionFactory
All Implemented Interfaces:
FunctionFactory

class NumberFunctionFactory extends Object implements FunctionFactory
Creates a Function doing numeric formatting, similar to {exp, number} in MessageFormat, and plural selection, similar to {exp, plural} and to {exp, selectordinal} in MessageFormat.
  • Field Details

    • kind

      private final String kind
    • CURRENCY_ISO_CODE

      private static final Pattern CURRENCY_ISO_CODE
  • Constructor Details

    • NumberFunctionFactory

      public NumberFunctionFactory(String kind)
  • Method Details

    • create

      public Function create(Locale locale, Map<String,?> fixedOptions)
      The method that is called to create a function.
      Specified by:
      create in interface FunctionFactory
      Parameters:
      locale - the locale to use for formatting / selection.
      fixedOptions - the options to use for formatting / selection. The keys and values are function dependent.
      Returns:
      the function.
    • functionForOptions

      private static LocalizedNumberFormatter functionForOptions(Locale locale, Map<String,?> fixedOptions, String kind)
    • getCurrency

      static String getCurrency(Map<String,?> options)