Package com.ibm.icu.text
Class CurrencyPluralInfo
java.lang.Object
com.ibm.icu.text.CurrencyPluralInfo
- All Implemented Interfaces:
Serializable
,Cloneable
This class represents the information needed by
DecimalFormat to format currency plural,
such as "3.00 US dollars" or "1.00 US dollar".
DecimalFormat creates for itself an instance of
CurrencyPluralInfo from its locale data.
If you need to change any of these symbols, you can get the
CurrencyPluralInfo object from your
DecimalFormat and modify it.
Following are the information needed for currency plural format and parse:
locale information,
plural rule of the locale,
currency plural pattern of the locale.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a CurrencyPluralInfo object for the defaultFORMAT
locale.CurrencyPluralInfo
(ULocale locale) Create a CurrencyPluralInfo object for the given locale.CurrencyPluralInfo
(Locale locale) Create a CurrencyPluralInfo object for the given locale. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Standard overrideboolean
Override equalsgetCurrencyPluralPattern
(String pluralCount) Given a plural count, gets currency plural pattern of this locale, used for currency plural formatstatic CurrencyPluralInfo
Gets a CurrencyPluralInfo instance for the default locale.static CurrencyPluralInfo
getInstance
(ULocale locale) Gets a CurrencyPluralInfo instance for the given locale.static CurrencyPluralInfo
getInstance
(Locale locale) Gets a CurrencyPluralInfo instance for the given locale.Get localeGets plural rules of this locale, used for currency plural formatint
hashCode()
Override hashCodeDeprecated.This API is ICU internal only.select
(PluralRules.FixedDecimal numberInfo) Deprecated.This API is ICU internal only.void
setCurrencyPluralPattern
(String pluralCount, String pattern) Set currency plural patterns.void
Set locale.void
setPluralRules
(String ruleDescription) Set plural rules.
-
Constructor Details
-
CurrencyPluralInfo
public CurrencyPluralInfo()Create a CurrencyPluralInfo object for the defaultFORMAT
locale.- See Also:
-
CurrencyPluralInfo
Create a CurrencyPluralInfo object for the given locale.- Parameters:
locale
- the locale
-
CurrencyPluralInfo
Create a CurrencyPluralInfo object for the given locale.- Parameters:
locale
- the locale
-
-
Method Details
-
getInstance
Gets a CurrencyPluralInfo instance for the default locale.- Returns:
- A CurrencyPluralInfo instance.
-
getInstance
Gets a CurrencyPluralInfo instance for the given locale.- Parameters:
locale
- the locale.- Returns:
- A CurrencyPluralInfo instance.
-
getInstance
Gets a CurrencyPluralInfo instance for the given locale.- Parameters:
locale
- the locale.- Returns:
- A CurrencyPluralInfo instance.
-
getPluralRules
Gets plural rules of this locale, used for currency plural format- Returns:
- plural rule
-
getCurrencyPluralPattern
Given a plural count, gets currency plural pattern of this locale, used for currency plural format- Parameters:
pluralCount
- currency plural count- Returns:
- a currency plural pattern based on plural count
-
getLocale
Get locale- Returns:
- locale
-
setPluralRules
Set plural rules. These are initially set in the constructor based on the locale, and usually do not need to be changed.- Parameters:
ruleDescription
- new plural rule description
-
setCurrencyPluralPattern
Set currency plural patterns. These are initially set in the constructor based on the locale, and usually do not need to be changed. The decimal digits part of the pattern cannot be specified via this method. All plural forms will use the same decimal pattern as set in the constructor of DecimalFormat. For example, you can't set "0.0" for plural "few" but "0.00" for plural "many".- Parameters:
pluralCount
- the plural count for which the currency pattern will be overridden.pattern
- the new currency plural pattern
-
setLocale
Set locale. This also sets both the plural rules and the currency plural patterns to be the defaults for the locale.- Parameters:
loc
- the new locale to set
-
clone
Standard override -
equals
Override equals -
hashCode
public int hashCode()Override hashCode -
select
Deprecated.This API is ICU internal only.Given a number, returns the keyword of the first rule that applies to the number. -
pluralPatternIterator
Deprecated.This API is ICU internal only.Currency plural pattern iterator.- Returns:
- a iterator on the currency plural pattern key set.
-