Note
This class deliberately resembles java.util.Currency but it has a completely independent implementation, and adds features not present in the JDK.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static class | Currency.CurrencyStringInfo
Deprecated
This API is ICU internal only.
|
| public static enum | Currency.CurrencyUsage
Currency Usage used for Decimal Format |
| pack-priv abstract static class |
| Modifier and Type | Field and Description |
|---|---|
| private static SoftReference | |
| private static SoftReference | |
| private static ICUCache | |
| private static final boolean | |
| private static final String[] | |
| public static final int | FORMAL_SYMBOL_NAME
Selector for getName() indicating the formal currency symbol. |
| private final String | isoCode
ISO 4217 3-letter code. |
| public static final int | LONG_NAME
Selector for getName() indicating the long name for a currency, such as "US Dollar" for USD. |
| public static final int | NARROW_SYMBOL_NAME
Selector for getName() indicating the narrow currency symbol. |
| public static final int | PLURAL_LONG_NAME
Selector for getName() indicating the plural long name for a currency, such as "US dollar" for USD in "1 US dollar", and "US dollars" for USD in "2 US dollars". |
| private static final int[] | |
| private static final CacheBase | |
| private static final long | |
| private static Currency. | |
| public static final int | SYMBOL_NAME
Selector for getName() indicating a symbolic name for a currency, such as "$" for USD. |
| private static final ULocale | |
| public static final int | VARIANT_SYMBOL_NAME
Selector for getName() indicating the variant currency symbol. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static Currency | |
| public static Currency | Returns: An equivalent ICU currency object.The Java currency object to convert. currency)Returns a Currency object based on the currency represented by the given java.util.Currency. |
| private static synchronized Set | |
| private static synchronized List | |
| public static Set | Returns: The set of available currencies. The returned set could be empty if there is no currency data available.Returns the set of available currencies. |
| public static String[] | Returns: The array of ISO currency codes.the locale for which to retrieve currency codes. loc, Date the date for which to retrieve currency codes for the given locale. d)Returns an array of Strings which contain the currency identifiers that are valid for the given locale on the given date. |
| public static String[] | Returns: The array of ISO currency codes.the loc, Date java. for which to retrieve currency codes.the date for which to retrieve currency codes for the given locale. d)Returns an array of Strings which contain the currency
identifiers that are valid for the given |
| public static Locale[] | Returns: an array of the available localesReturn an array of the locales for which a currency is defined. |
| public static ULocale[] | Returns: an array of the available ulocalesReturn an array of the ulocales for which a currency is defined. |
| public String | |
| private static List | |
| public int | Returns: a non-negative number of fraction digits to be displayedReturns the number of the number of fraction digits that should be displayed for this currency. |
| public int | Returns: a non-negative number of fraction digits to be displayedthe usage of currency(Standard or Cash) UsageReturns the number of the number of fraction digits that should be displayed for this currency with Usage. |
| public String | Returns: The display name of this currencyReturns the display name for this currency in the default locale. |
| public String | Returns: The display name of this currency for the specified localelocale in which to display currency locale)Returns the display name for this currency in the given locale. |
| public static Currency | Returns: the currency object for this localethe locale locale)Returns a currency object for the default currency in the given locale. |
| public static Currency | |
| public static Currency | Returns: the currency for this iso codethe iso code theISOCode)Returns a currency object given an ISO 4217 3-letter code. |
| public static final String[] | Returns: an array of values for the given key and the locale. If there is no data, the array will be empty.key whose values to look up. the only recognized key is "currency" key, ULocale the locale locale, boolean if true, return only values that are currently used in the locale.
Otherwise returns all values. commonlyUsed)Given a key and a locale, returns an array of values for the key for which data exists. |
| public String | Returns: display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.locale in which to display currency locale, int selector for which kind of name to return.
The nameStyle should be SYMBOL_NAME, NARROW_SYMBOL_NAME,
or LONG_NAME. Otherwise, throw IllegalArgumentException. nameStyle, boolean[] isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
display names are static strings;
since ICU 4.4, ChoiceFormat patterns are no longer supported isChoiceFormat)Returns the display name for the given currency in the given locale. |
| public String | Returns: display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.locale in which to display currency locale, int selector for which kind of name to return.
The nameStyle should be SYMBOL_NAME, NARROW_SYMBOL_NAME,
or LONG_NAME. Otherwise, throw IllegalArgumentException. nameStyle, boolean[] isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
display names are static strings;
since ICU 4.4, ChoiceFormat patterns are no longer supported isChoiceFormat)Returns the display name for the given currency in the given locale. |
| public String | Returns: display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.locale in which to display currency locale, int selector for which kind of name to return nameStyle, String plural count string for this locale pluralCount, boolean[] isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
display names are static strings;
since ICU 4.4, ChoiceFormat patterns are no longer supported isChoiceFormat)Returns the display name for the given currency in the given locale. |
| public String | Returns: display string for this currency. If the resource data contains no entry for this currency, then the ISO 4217 code is returned.locale in which to display currency locale, int selector for which kind of name to return nameStyle, String plural count string for this locale pluralCount, boolean[] isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
display names are static strings;
since ICU 4.4, ChoiceFormat patterns are no longer supported isChoiceFormat)Returns the display name for the given currency in the given locale. |
| public int | Returns: The ISO 4217 numeric code of this currency.Returns the ISO 4217 numeric code for this currency object. |
| public static TextTrieMap | |
| public double | Returns: the non-negative rounding increment, or 0.0 if noneReturns the rounding increment for this currency, or 0.0 if no rounding is done by this currency. |
| public double | Returns: the non-negative rounding increment, or 0.0 if nonethe usage of currency(Standard or Cash) UsageReturns the rounding increment for this currency, or 0.0 if no rounding is done by this currency with the Usage. |
| private static Currency. | |
| public String | getSymbol()
Convenience and compatibility override of getName that
requests the symbol name for the default |
| public String | |
| public String | |
| private static List | Returns: a list of tender currenciesthe filter to apply to the tender currencies filterReturns the list of remaining tender currencies after a filter is applied. |
| private static boolean | |
| public static boolean | Returns: true if the given ISO 4217 3-letter code is supported on the specified date range.The ISO 4217 3-letter code. code, Date The lower bound of the date range, inclusive. When from, Date from is null, check the availability
of the currency any date before toThe upper bound of the date range, inclusive. When to)to is null, check the availability of
the currency any date after fromQueries if the given ISO 4217 3-letter code is available on the specified date range. |
| private static Currency | |
| public static String | Returns: the ISO 4217 code, as a string, of the best match, or null if there is no matchthe locale of the display names to match locale, String the text to parse text, int parse against currency type: LONG_NAME only or not type, ParsePosition input-output position; on input, the position within
text to match; must have 0 <= pos.getIndex() < text.length();
on output, the position after the last matched character. If
the parse fails, the position in unchanged upon output. pos)
Deprecated
This API is ICU internal only.
Attempt to parse the given string as a currency, either as a
display name in the given locale, or as a 3-letter ISO 4217
code.
|
| private Object | |
| public static Object | Returns: a registry key that can be used to unregister this currencythe currency to register currency, ULocale the ulocale under which to register the currency locale)Registers a new currency for the provided locale. |
| private static void | |
| public Currency | Returns: An equivalent Java currency object.Returns a java.util.Currency object based on the currency represented by this Currency. |
| public String | toString()
Overrides com. |
| public static boolean | unregister(Object
the registry key returned from registerInstance registryKey)Unregister the currency associated with this key (obtained from registerInstance). |
| private Object |