/** * Lookup a currency based on the ISO4217 currency code. * * @param currencyCode ISO4217 currency code * @return currency data, or null if code not found */ public final CurrencyData lookup(String currencyCode) { ensureCurrencyMap(); if (GWT.isScript()) { return lookupNative(dataMapNative, currencyCode); } else { return dataMapJava.get(currencyCode); } }
/** * Lookup a currency name based on the ISO4217 currency code. * * @param currencyCode ISO4217 currency code * @return name of the currency, or null if code not found */ public final String lookupName(String currencyCode) { ensureNamesMap(); if (GWT.isScript()) { return lookupNameNative(namesMapNative, currencyCode); } else { String result = namesMapJava.get(currencyCode); return (result == null) ? currencyCode : result; } }
/** * Provides the standard currency format for the current locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the default locale */ public static NumberFormat getCurrencyFormat() { if (cachedCurrencyFormat == null) { cachedCurrencyFormat = getCurrencyFormat(CurrencyList.get().getDefault()); } return cachedCurrencyFormat; }
/** * Return the default currency data for this locale. * * Generated implementations override this method. */ public CurrencyData getDefault() { if (GWT.isScript()) { return getDefaultNative(); } else { return getDefaultJava(); } }
/** * Ensure that the map of currency data has been initialized. */ private void ensureCurrencyMap() { if (GWT.isScript()) { if (dataMapNative == null) { dataMapNative = loadCurrencyMapNative(); } } else { if (dataMapJava == null) { dataMapJava = loadCurrencyMapJava(); } } }
/** * Lookup a currency code. * * @param currencyCode ISO4217 currency code * @return a CurrencyData instance * @throws IllegalArgumentException if the currency code is unknown */ private static CurrencyData lookupCurrency(String currencyCode) { CurrencyData currencyData = CurrencyList.get().lookup(currencyCode); if (currencyData == null) { throw new IllegalArgumentException("Currency code " + currencyCode + " is unkown in locale " + LocaleInfo.getCurrentLocale().getLocaleName()); } return currencyData; }
/** * Returns an iterator for the list of currencies, optionally including * deprecated ones. * * @param includeDeprecated true if deprecated currencies should be included */ public final Iterator<CurrencyData> iterator(boolean includeDeprecated) { ensureCurrencyMap(); ArrayList<CurrencyData> collection = new ArrayList<CurrencyData>(); if (GWT.isScript()) { loadCurrencyValuesNative(dataMapNative, collection); } else { for (CurrencyData item : dataMapJava.values()) { collection.add(item); } } if (!includeDeprecated) { ArrayList<CurrencyData> newCollection = new ArrayList<CurrencyData>(); for (CurrencyData value : collection) { if (!value.isDeprecated()) { newCollection.add(value); } } collection = newCollection; } return Collections.unmodifiableList(collection).iterator(); }
/** * Returns an iterator for the list of currencies. * * Deprecated currencies will not be included. */ @Override public final Iterator<CurrencyData> iterator() { return iterator(false); }
/** * Return the default currency data for this locale. * * Generated implementations override this method. */ public CurrencyData getDefault() { if (GWT.isScript()) { return getDefaultNative(); } else { return getDefaultJava(); } }
/** * Ensure that the map of currency data has been initialized. */ private void ensureCurrencyMap() { if (GWT.isScript()) { if (dataMapNative == null) { dataMapNative = loadCurrencyMapNative(); } } else { if (dataMapJava == null) { dataMapJava = loadCurrencyMapJava(); } } }
/** * Lookup a currency code. * * @param currencyCode ISO4217 currency code * @return a CurrencyData instance * @throws IllegalArgumentException if the currency code is unknown */ private static CurrencyData lookupCurrency(String currencyCode) { CurrencyData currencyData = CurrencyList.get().lookup(currencyCode); if (currencyData == null) { throw new IllegalArgumentException("Currency code " + currencyCode + " is unkown in locale " + LocaleInfo.getCurrentLocale().getLocaleName()); } return currencyData; }
/** * Returns an iterator for the list of currencies, optionally including * deprecated ones. * * @param includeDeprecated true if deprecated currencies should be included */ public final Iterator<CurrencyData> iterator(boolean includeDeprecated) { ensureCurrencyMap(); ArrayList<CurrencyData> collection = new ArrayList<CurrencyData>(); if (GWT.isScript()) { loadCurrencyValuesNative(dataMapNative, collection); } else { for (CurrencyData item : dataMapJava.values()) { collection.add(item); } } if (!includeDeprecated) { ArrayList<CurrencyData> newCollection = new ArrayList<CurrencyData>(); for (CurrencyData value : collection) { if (!value.isDeprecated()) { newCollection.add(value); } } collection = newCollection; } return Collections.unmodifiableList(collection).iterator(); }
/** * Returns an iterator for the list of currencies. * * Deprecated currencies will not be included. */ @Override public final Iterator<CurrencyData> iterator() { return iterator(false); }
/** * Gets a <code>NumberFormat</code> instance for the default locale using * the specified pattern and the default currencyCode. * * @param pattern pattern for this formatter * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern) { return new NumberFormat(pattern, CurrencyList.get().getDefault(), true); }
/** * Return the default currency data for this locale. * * Generated implementations override this method. */ public CurrencyData getDefault() { if (GWT.isScript()) { return getDefaultNative(); } else { return getDefaultJava(); } }
/** * Ensure that the map of currency data has been initialized. */ private void ensureCurrencyMap() { if (GWT.isScript()) { if (dataMapNative == null) { dataMapNative = loadCurrencyMapNative(); } } else { if (dataMapJava == null) { dataMapJava = loadCurrencyMapJava(); } } }
/** * Lookup a currency based on the ISO4217 currency code. * * @param currencyCode ISO4217 currency code * @return currency data, or null if code not found */ public final CurrencyData lookup(String currencyCode) { ensureCurrencyMap(); if (GWT.isScript()) { return lookupNative(dataMapNative, currencyCode); } else { return dataMapJava.get(currencyCode); } }
/** * Lookup a currency name based on the ISO4217 currency code. * * @param currencyCode ISO4217 currency code * @return name of the currency, or null if code not found */ public final String lookupName(String currencyCode) { ensureNamesMap(); if (GWT.isScript()) { return lookupNameNative(namesMapNative, currencyCode); } else { String result = namesMapJava.get(currencyCode); return (result == null) ? currencyCode : result; } }
/** * Lookup a currency code. * * @param currencyCode ISO4217 currency code * @return a CurrencyData instance * @throws IllegalArgumentException if the currency code is unknown */ private static CurrencyData lookupCurrency(String currencyCode) { CurrencyData currencyData = CurrencyList.get().lookup(currencyCode); if (currencyData == null) { throw new IllegalArgumentException("Currency code " + currencyCode + " is unkown in locale " + LocaleInfo.getCurrentLocale().getLocaleName()); } return currencyData; }
/** * Returns an iterator for the list of currencies, optionally including * deprecated ones. * * @param includeDeprecated true if deprecated currencies should be included */ public final Iterator<CurrencyData> iterator(boolean includeDeprecated) { ensureCurrencyMap(); ArrayList<CurrencyData> collection = new ArrayList<CurrencyData>(); if (GWT.isScript()) { loadCurrencyValuesNative(dataMapNative, collection); } else { for (CurrencyData item : dataMapJava.values()) { collection.add(item); } } if (!includeDeprecated) { ArrayList<CurrencyData> newCollection = new ArrayList<CurrencyData>(); for (CurrencyData value : collection) { if (!value.isDeprecated()) { newCollection.add(value); } } collection = newCollection; } return Collections.unmodifiableList(collection).iterator(); }