2 *******************************************************************************
\r
3 * Copyright (C) 2009-2010, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 package com.ibm.icu.text;
\r
9 import java.util.Map;
\r
11 import com.ibm.icu.impl.CurrencyData;
\r
12 import com.ibm.icu.util.ULocale;
\r
15 * Returns currency names localized for a locale.
\r
17 * @provisional This API might change or be removed in a future release.
\r
19 public abstract class CurrencyDisplayNames {
\r
21 * Return an instance of CurrencyDisplayNames that provides information
\r
22 * localized for display in the provided locale.
\r
23 * @param locale the locale into which to localize the names
\r
24 * @return a CurrencyDisplayNames
\r
26 * @provisional This API might change or be removed in a future release.
\r
28 public static CurrencyDisplayNames getInstance(ULocale locale) {
\r
29 return CurrencyData.provider.getInstance(locale, true);
\r
33 * Returns true if currency display name data is available.
\r
34 * @return true if currency display name data is available
\r
36 * @provisional This API might change or be removed in a future release.
\r
38 public static boolean hasData() {
\r
39 return CurrencyData.provider.hasData();
\r
43 * Returns the locale used to determine how to translate the currency names.
\r
44 * This is not necessarily the same locale passed to {@link #getInstance(ULocale)}.
\r
45 * If hasData is false, returns {@link com.ibm.icu.util.ULocale#ROOT}.
\r
46 * @return the display locale
\r
48 * @provisional This API might change or be removed in a future release.
\r
50 public abstract ULocale getLocale();
\r
53 * Returns the symbol for the currency with the provided ISO code.
\r
54 * If hasData is false, returns the provided ISO code.
\r
55 * @param isoCode the three-letter ISO code.
\r
56 * @return the display name.
\r
58 * @provisional This API might change or be removed in a future release.
\r
60 public abstract String getSymbol(String isoCode);
\r
63 * Returns the 'long name' for the currency with the provided ISO code.
\r
64 * If hasData is false, returns the provided ISO code.
\r
65 * @param isoCode the three-letter ISO code
\r
66 * @return the display name
\r
68 * @provisional This API might change or be removed in a future release.
\r
70 public abstract String getName(String isoCode);
\r
73 * Returns a 'plural name' for the currency with the provided ISO code corresponding to
\r
74 * the pluralKey. If hasData is false, returns the provided ISO code.
\r
75 * @param isoCode the three-letter ISO code
\r
76 * @param pluralKey the plural key, for example "one", "other"
\r
77 * @return the display name
\r
78 * @see com.ibm.icu.text.PluralRules
\r
80 * @provisional This API might change or be removed in a future release.
\r
82 public abstract String getPluralName(String isoCode, String pluralKey);
\r
85 * Returns a mapping from localized symbols and currency codes to currency codes.
\r
86 * If hasData is false, returns an empty map.
\r
87 * The returned map is unmodifiable.
\r
90 * @provisional This API might change or be removed in a future release.
\r
92 public abstract Map<String, String> symbolMap();
\r
95 * Returns a mapping from localized names (standard and plural) to currency codes.
\r
96 * If hasData is false, returns an empty map.
\r
97 * The returned map is unmodifiable.
\r
100 * @provisional This API might change or be removed in a future release.
\r
102 public abstract Map<String, String> nameMap();
\r
105 * Sole constructor. (For invocation by subclass constructors,
\r
106 * typically implicit.)
\r
108 * @deprecated This API is ICU internal only.
\r
110 protected CurrencyDisplayNames() {
\r