Home | History | Annotate | Download | only in util

Lines Matching full:currency

35 // BEGIN Android-changed: Removed docs about superseding runtime currency data.
38 * Represents a currency. Currencies are identified by their ISO 4217 currency
43 * <code>Currency</code> instance for any given currency. Therefore, there's
44 * no public constructor. You obtain a <code>Currency</code> instance using
49 // END Android-changed: Removed docs about superseding runtime currency data.
50 public final class Currency implements Serializable {
55 * ISO 4217 currency code for this currency.
63 private static ConcurrentMap<String, Currency> instances = new ConcurrentHashMap<>(7);
64 private static HashSet<Currency> available;
66 // Android-changed: Implement Currency on top of ICU throughout.
68 private transient final android.icu.util.Currency icuCurrency;
71 * Constructs a <code>Currency</code> instance. The constructor is private
73 * given currency.
75 private Currency(android.icu.util.Currency icuCurrency) {
81 * Returns the <code>Currency</code> instance for the given currency code.
83 * @param currencyCode the ISO 4217 code of the currency
84 * @return the <code>Currency</code> instance for the given currency code
89 public static Currency getInstance(String currencyCode) {
91 Currency instance = instances.get(currencyCode);
95 android.icu.util.Currency icuInstance =
96 android.icu.util.Currency.getInstance(currencyCode);
100 Currency currencyVal = new Currency(icuInstance);
107 * Returns the <code>Currency</code> instance for the country of the
116 * have a currency, such as Antarctica.
118 * @param locale the locale for whose country a <code>Currency</code>
120 * @return the <code>Currency</code> instance for the country of the given
127 public static Currency getInstance(Locale locale) {
129 android.icu.util.Currency icuInstance =
130 android.icu.util.Currency.getInstance(locale);
154 * @return the set of available currencies. If there is no currency
158 public static Set<Currency> getAvailableCurrencies() {
159 synchronized(Currency.class) {
162 Set<android.icu.util.Currency> icuAvailableCurrencies
163 = android.icu.util.Currency.getAvailableCurrencies();
165 for (android.icu.util.Currency icuCurrency : icuAvailableCurrencies) {
166 Currency currency = getInstance(icuCurrency.getCurrencyCode());
167 if (currency == null) {
168 currency = new Currency(icuCurrency);
169 instances.put(currency.currencyCode, currency);
171 available.add(currency);
178 Set<Currency> result = (Set<Currency>) available.clone();
183 * Gets the ISO 4217 currency code of this currency.
185 * @return the ISO 4217 currency code of this currency.
192 * Gets the symbol of this currency for the default
196 * symbol can be determined, the ISO 4217 currency code is returned.
202 * @return the symbol of this currency for the default
210 * Gets the symbol of this currency for the specified locale.
213 * symbol can be determined, the ISO 4217 currency code is returned.
215 * @param locale the locale for which a display name for this currency is
217 * @return the symbol of this currency for the specified locale
230 * Gets the default number of fraction digits used with this currency.
236 * @return the default number of fraction digits used with this currency
248 * Returns the ISO 4217 numeric code of this currency.
250 * @return the ISO 4217 numeric code of this currency
260 * Gets the name that is suitable for displaying this currency for
263 * for the default locale, the ISO 4217 currency code is returned.
269 * @return the display name of this currency for the default
278 * Gets the name that is suitable for displaying this currency for
280 * for the specified locale, the ISO 4217 currency code is returned.
282 * @param locale the locale for which a display name for this currency is
284 * @return the display name of this currency for the specified locale
294 * Returns the ISO 4217 currency code of this currency.
296 * @return the ISO 4217 currency code of this currency
305 * Resolves instances being deserialized to a single instance per currency.