CurrencyPluralInfo
open class CurrencyPluralInfo : Cloneable, Serializable
kotlin.Any | |
↳ | android.icu.text.CurrencyPluralInfo |
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.
Summary
Public constructors | |
---|---|
Create a CurrencyPluralInfo object for the default |
|
CurrencyPluralInfo(locale: ULocale!) Create a CurrencyPluralInfo object for the given locale. |
|
CurrencyPluralInfo(locale: Locale!) Create a CurrencyPluralInfo object for the given locale. |
Public methods | |
---|---|
open Any |
clone() Standard override |
open Boolean |
Override equals |
open String! |
getCurrencyPluralPattern(pluralCount: String!) Given a plural count, gets currency plural pattern of this locale, used for currency plural format |
open static CurrencyPluralInfo! |
Gets a CurrencyPluralInfo instance for the default locale. |
open static CurrencyPluralInfo! |
getInstance(locale: ULocale!) Gets a CurrencyPluralInfo instance for the given locale. |
open static CurrencyPluralInfo! |
getInstance(locale: Locale!) Gets a CurrencyPluralInfo instance for the given locale. |
open ULocale! |
Get locale |
open PluralRules! |
Gets plural rules of this locale, used for currency plural format |
open Unit |
setCurrencyPluralPattern(pluralCount: String!, pattern: String!) Set currency plural patterns. |
open Unit |
Set locale. |
open Unit |
setPluralRules(ruleDescription: String!) Set plural rules. |
Public constructors
CurrencyPluralInfo
CurrencyPluralInfo()
Create a CurrencyPluralInfo object for the default FORMAT
locale.
CurrencyPluralInfo
CurrencyPluralInfo(locale: ULocale!)
Create a CurrencyPluralInfo object for the given locale.
Parameters | |
---|---|
locale |
ULocale!: the locale |
CurrencyPluralInfo
CurrencyPluralInfo(locale: Locale!)
Create a CurrencyPluralInfo object for the given locale.
Parameters | |
---|---|
locale |
Locale!: the locale |
Public methods
clone
open fun clone(): Any
Standard override
Return | |
---|---|
Any |
a clone of this instance. |
Exceptions | |
---|---|
java.lang.CloneNotSupportedException |
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. |
equals
open fun equals(other: Any?): Boolean
Override equals
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getCurrencyPluralPattern
open fun getCurrencyPluralPattern(pluralCount: String!): String!
Given a plural count, gets currency plural pattern of this locale, used for currency plural format
Parameters | |
---|---|
pluralCount |
String!: currency plural count |
Return | |
---|---|
String! |
a currency plural pattern based on plural count |
getInstance
open static fun getInstance(): CurrencyPluralInfo!
Gets a CurrencyPluralInfo instance for the default locale.
Return | |
---|---|
CurrencyPluralInfo! |
A CurrencyPluralInfo instance. |
getInstance
open static fun getInstance(locale: ULocale!): CurrencyPluralInfo!
Gets a CurrencyPluralInfo instance for the given locale.
Parameters | |
---|---|
locale |
ULocale!: the locale. |
Return | |
---|---|
CurrencyPluralInfo! |
A CurrencyPluralInfo instance. |
getInstance
open static fun getInstance(locale: Locale!): CurrencyPluralInfo!
Gets a CurrencyPluralInfo instance for the given locale.
Parameters | |
---|---|
locale |
Locale!: the locale. |
Return | |
---|---|
CurrencyPluralInfo! |
A CurrencyPluralInfo instance. |
getPluralRules
open fun getPluralRules(): PluralRules!
Gets plural rules of this locale, used for currency plural format
Return | |
---|---|
PluralRules! |
plural rule |
setCurrencyPluralPattern
open fun setCurrencyPluralPattern(
pluralCount: String!,
pattern: String!
): Unit
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 |
String!: the plural count for which the currency pattern will be overridden. |
pattern |
String!: the new currency plural pattern |
setLocale
open fun setLocale(loc: ULocale!): Unit
Set locale. This also sets both the plural rules and the currency plural patterns to be the defaults for the locale.
Parameters | |
---|---|
loc |
ULocale!: the new locale to set |
setPluralRules
open fun setPluralRules(ruleDescription: String!): Unit
Set plural rules. These are initially set in the constructor based on the locale, and usually do not need to be changed.
Parameters | |
---|---|
ruleDescription |
String!: new plural rule description |