]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/text/CurrencyDisplayNames.java
Clean up imports.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / text / CurrencyDisplayNames.java
1 /*
2  *******************************************************************************
3  * Copyright (C) 2009-2013, International Business Machines Corporation and    *
4  * others. All Rights Reserved.                                                *
5  *******************************************************************************
6  */
7 package com.ibm.icu.text;
8
9 import java.util.Map;
10
11 import com.ibm.icu.impl.CurrencyData;
12 import com.ibm.icu.util.ULocale;
13
14 /**
15  * Returns currency names localized for a locale.
16  * 
17  * This class is not intended for public subclassing.
18  * 
19  * @stable ICU 4.4
20  */
21 public abstract class CurrencyDisplayNames {
22     /**
23      * Return an instance of CurrencyDisplayNames that provides information
24      * localized for display in the provided locale.  If there is no data for the
25      * provided locale, this falls back to the current default locale; if there
26      * is no data for that either, it falls back to the root locale.  Substitute
27      * values are returned from APIs when there is no data for the requested ISO 
28      * code.
29      * 
30      * @param locale the locale into which to localize the names
31      * @return a CurrencyDisplayNames
32      * @stable ICU 4.4
33      */
34     public static CurrencyDisplayNames getInstance(ULocale locale) {
35         return CurrencyData.provider.getInstance(locale, true);
36     }
37
38     /**
39      * Return an instance of CurrencyDisplayNames that provides information
40      * localized for display in the provided locale.  If noSubstitute is false,
41      * this behaves like {@link #getInstance(ULocale)}.  Otherwise, 1) if there
42      * is no supporting data for the locale at all, there is no fallback through
43      * the default locale or root, and null is returned, and 2) if there is data
44      * for the locale, but not data for the requested ISO code, null is returned
45      * from those APIs instead of a substitute value.
46      * 
47      * @param locale the locale into which to localize the names
48      * @param noSubstitute if true, do not return substitute values.
49      * @return a CurrencyDisplayNames
50      * @stable ICU 49
51      */
52     public static CurrencyDisplayNames getInstance(ULocale locale, boolean noSubstitute) {
53         return CurrencyData.provider.getInstance(locale, !noSubstitute);
54     }
55
56     /**
57      * Returns true if currency display name data is available.
58      * @return true if currency display name data is available
59      * @internal
60      * @deprecated This API is ICU internal only.
61      */
62     public static boolean hasData() {
63         return CurrencyData.provider.hasData();
64     }
65
66     /**
67      * Returns the locale used to determine how to translate the currency names.
68      * This is not necessarily the same locale passed to {@link #getInstance(ULocale)}.
69      * @return the display locale
70      * @stable ICU 49
71      */
72     public abstract ULocale getULocale();
73
74     /**
75      * Returns the symbol for the currency with the provided ISO code.  If
76      * there is no data for the ISO code, substitutes isoCode or returns null.
77      * 
78      * @param isoCode the three-letter ISO code.
79      * @return the display name.
80      * @stable ICU 4.4
81      */
82     public abstract String getSymbol(String isoCode);
83
84     /**
85      * Returns the 'long name' for the currency with the provided ISO code.
86      * If there is no data for the ISO code, substitutes isoCode or returns null.
87      * 
88      * @param isoCode the three-letter ISO code
89      * @return the display name
90      * @stable ICU 4.4
91      */
92     public abstract String getName(String isoCode);
93
94     /**
95      * Returns a 'plural name' for the currency with the provided ISO code corresponding to
96      * the pluralKey.  If there is no data for the ISO code, substitutes isoCode or
97      * returns null.  If there is data for the ISO code but no data for the plural key, 
98      * substitutes the 'other' value (and failing that the isoCode) or returns null.
99      * 
100      * @param isoCode the three-letter ISO code
101      * @param pluralKey the plural key, for example "one", "other"
102      * @return the display name
103      * @see com.ibm.icu.text.PluralRules
104      * @stable ICU 4.4
105      */
106     public abstract String getPluralName(String isoCode, String pluralKey);
107
108     /**
109      * Returns a mapping from localized symbols and currency codes to currency codes.
110      * The returned map is unmodifiable.
111      * @return the map
112      * @stable ICU 4.4
113      */
114     public abstract Map<String, String> symbolMap();
115
116     /**
117      * Returns a mapping from localized names (standard and plural) to currency codes.
118      * The returned map is unmodifiable.
119      * @return the map
120      * @stable ICU 4.4
121      */
122     public abstract Map<String, String> nameMap();
123
124     /**
125      * Sole constructor.  (For invocation by subclass constructors,
126      * typically implicit.)
127      * @internal
128      * @deprecated This API is ICU internal only.
129      */
130     protected CurrencyDisplayNames() {
131     }
132 }