code: private static NumberFormat getInstance(Locale desiredLocale,
                                             int choice) {
          // Check whether a provider can provide an implementation that's closer
          // to the requested locale than what the Java runtime itself can provide.
          /* J2ObjC: java.text.spi is not provided.
          LocaleServiceProviderPool pool =
              LocaleServiceProviderPool.getPool(NumberFormatProvider.class);
          if (pool.hasProviders()) {
              NumberFormat providersInstance = pool.getLocalizedObject(
                                      NumberFormatGetter.INSTANCE,
                                      desiredLocale,
                                      choice);
              if (providersInstance != null) {
                  return providersInstance;
              }
          }*/
  
          /* try the cache first */
          String[] numberPatterns = (String[])cachedLocaleData.get(desiredLocale);
          if (numberPatterns == null) { /* cache miss */
              LocaleData data = LocaleData.get(desiredLocale);
              numberPatterns = new String[4];
              numberPatterns[NUMBERSTYLE] = data.numberPattern;
              numberPatterns[CURRENCYSTYLE] = data.currencyPattern;
              numberPatterns[PERCENTSTYLE] = data.percentPattern;
              numberPatterns[INTEGERSTYLE] = data.integerPattern;
              /* update cache */
              cachedLocaleData.put(desiredLocale, numberPatterns);
          }
  
          DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(desiredLocale);
          int entry = (choice == INTEGERSTYLE) ? NUMBERSTYLE : choice;
          DecimalFormat format = new DecimalFormat(numberPatterns[entry], symbols);
  
          if (choice == INTEGERSTYLE) {
              format.setMaximumFractionDigits(0);
              format.setDecimalSeparatorAlwaysShown(false);
              format.setParseIntegerOnly(true);
          } else if (choice == CURRENCYSTYLE) {
              adjustForCurrencyDefaultFractionDigits(format, symbols);
          }
  
          return format;
      }
docs: =======================privates===============================