]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/main/classes/core/src/com/ibm/icu/text/CurrencyDisplayNames.java
go
[Dictionary.git] / jars / icu4j-4_4_2-src / main / classes / core / src / com / ibm / icu / text / CurrencyDisplayNames.java
1 /*\r
2  *******************************************************************************\r
3  * Copyright (C) 2009-2010, International Business Machines Corporation and    *\r
4  * others. All Rights Reserved.                                                *\r
5  *******************************************************************************\r
6  */\r
7 package com.ibm.icu.text;\r
8 \r
9 import java.util.Map;\r
10 \r
11 import com.ibm.icu.impl.CurrencyData;\r
12 import com.ibm.icu.util.ULocale;\r
13 \r
14 /**\r
15  * Returns currency names localized for a locale.\r
16  * @draft ICU 4.4\r
17  * @provisional This API might change or be removed in a future release.\r
18  */\r
19 public abstract class CurrencyDisplayNames {\r
20     /**\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
25      * @draft ICU 4.4\r
26      * @provisional This API might change or be removed in a future release.\r
27      */\r
28     public static CurrencyDisplayNames getInstance(ULocale locale) {\r
29         return CurrencyData.provider.getInstance(locale, true);\r
30     }\r
31 \r
32     /**\r
33      * Returns true if currency display name data is available.\r
34      * @return true if currency display name data is available\r
35      * @draft ICU 4.4\r
36      * @provisional This API might change or be removed in a future release.\r
37      */\r
38     public static boolean hasData() {\r
39         return CurrencyData.provider.hasData();\r
40     }\r
41 \r
42     /**\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
47      * @draft ICU 4.4\r
48      * @provisional This API might change or be removed in a future release.\r
49      */\r
50     public abstract ULocale getLocale();\r
51 \r
52     /**\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
57      * @draft ICU 4.4\r
58      * @provisional This API might change or be removed in a future release.\r
59      */\r
60     public abstract String getSymbol(String isoCode);\r
61 \r
62     /**\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
67      * @draft ICU 4.4\r
68      * @provisional This API might change or be removed in a future release.\r
69      */\r
70     public abstract String getName(String isoCode);\r
71 \r
72     /**\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
79      * @draft ICU 4.4\r
80      * @provisional This API might change or be removed in a future release.\r
81      */\r
82     public abstract String getPluralName(String isoCode, String pluralKey);\r
83 \r
84     /**\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
88      * @return the map\r
89      * @draft ICU 4.4\r
90      * @provisional This API might change or be removed in a future release.\r
91      */\r
92     public abstract Map<String, String> symbolMap();\r
93 \r
94     /**\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
98      * @return the map\r
99      * @draft ICU 4.4\r
100      * @provisional This API might change or be removed in a future release.\r
101      */\r
102     public abstract Map<String, String> nameMap();\r
103 \r
104     /**\r
105      * Sole constructor.  (For invocation by subclass constructors,\r
106      * typically implicit.)\r
107      * @internal\r
108      * @deprecated This API is ICU internal only.\r
109      */\r
110     protected CurrencyDisplayNames() {\r
111     }\r
112 }\r