Top Description Fields Constructors Methods
com.ibm.icu.text

public Class CurrencyPluralInfo

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Imports
java.io.Serializable, java.util.HashMap, .Iterator, .Locale, .Map, com.ibm.icu.impl.CurrencyData, com.ibm.icu.util.ICUCloneNotSupportedException, .ULocale, .ULocale.Category

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.
ICU Status
Stable since ICU 4.2.

Field Summary

Modifier and TypeField and Description
private static final String
private static final char[]
private Map<String, String>
private PluralRules
private static final long
private static final char[]
private static final String
private ULocale

Constructor Summary

AccessConstructor and Description
public
CurrencyPluralInfo()

Create a CurrencyPluralInfo object for the default FORMAT locale.

public
CurrencyPluralInfo(Locale
the locale
locale
)

Create a CurrencyPluralInfo object for the given locale.

public
CurrencyPluralInfo(ULocale
the locale
locale
)

Create a CurrencyPluralInfo object for the given locale.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Standard override
public boolean
equals(Object
the reference object with which to compare.
a
)

Overrides java.lang.Object.equals.

Override equals
public String

Returns:

a currency plural pattern based on plural count
getCurrencyPluralPattern
(String
currency plural count
pluralCount
)

Given a plural count, gets currency plural pattern of this locale, used for currency plural format

public static CurrencyPluralInfo

Returns:

A CurrencyPluralInfo instance.
getInstance
()

Gets a CurrencyPluralInfo instance for the default locale.

public static CurrencyPluralInfo

Returns:

A CurrencyPluralInfo instance.
getInstance
(Locale
the locale.
locale
)

Gets a CurrencyPluralInfo instance for the given locale.

public static CurrencyPluralInfo

Returns:

A CurrencyPluralInfo instance.
getInstance
(ULocale
the locale.
locale
)

Gets a CurrencyPluralInfo instance for the given locale.

public ULocale

Returns:

locale
getLocale
()

Get locale

public PluralRules

Returns:

plural rule
getPluralRules
()

Gets plural rules of this locale, used for currency plural format

public int
hashCode()

Overrides java.lang.Object.hashCode.

Override hashCode
private void
public Iterator<String>

Returns:

a iterator on the currency plural pattern key set.
pluralPatternIterator
()

Deprecated This API is ICU internal only.
Currency plural pattern iterator.
pack-priv String
select(double number)

Deprecated This API is ICU internal only.
Given a number, returns the keyword of the first rule that applies to the number.
public String
select(PluralRules.FixedDecimal numberInfo)

Deprecated This API is ICU internal only.
Given a number, returns the keyword of the first rule that applies to the number.
public void
setCurrencyPluralPattern(String
the plural count for which the currency pattern will be overridden.
pluralCount
,
String
the new currency plural pattern
pattern
)

Set currency plural patterns.

public void
setLocale(ULocale
the new locale to set
loc
)

Set locale.

public void
setPluralRules(String
new plural rule description
ruleDescription
)

Set plural rules.

private void
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultCurrencyPluralPatternback to summary
private static final String defaultCurrencyPluralPattern
defaultCurrencyPluralPatternCharback to summary
private static final char[] defaultCurrencyPluralPatternChar
pluralCountToCurrencyUnitPatternback to summary
private Map<String, String> pluralCountToCurrencyUnitPattern
pluralRulesback to summary
private PluralRules pluralRules
serialVersionUIDback to summary
private static final long serialVersionUID
tripleCurrencySignback to summary
private static final char[] tripleCurrencySign
tripleCurrencyStrback to summary
private static final String tripleCurrencyStr
ulocaleback to summary
private ULocale ulocale

Constructor Detail

CurrencyPluralInfoback to summary
public CurrencyPluralInfo()

Create a CurrencyPluralInfo object for the default FORMAT locale.

ICU Status
Stable since ICU 4.2.
See Also
Category#FORMAT
CurrencyPluralInfoback to summary
public CurrencyPluralInfo(Locale locale)

Create a CurrencyPluralInfo object for the given locale.

Parameters
locale:Locale

the locale

ICU Status
Stable since ICU 4.2.
CurrencyPluralInfoback to summary
public CurrencyPluralInfo(ULocale locale)

Create a CurrencyPluralInfo object for the given locale.

Parameters
locale:ULocale

the locale

ICU Status
Stable since ICU 4.2.

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Standard override

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
ICU Status
Stable since ICU 4.2.
equalsback to summary
public boolean equals(Object a)

Overrides java.lang.Object.equals.

Override equals

Parameters
a:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
ICU Status
Stable since ICU 4.2.
getCurrencyPluralPatternback to summary
public String getCurrencyPluralPattern(String pluralCount)

Given a plural count, gets currency plural pattern of this locale, used for currency plural format

Parameters
pluralCount:String

currency plural count

Returns:String

a currency plural pattern based on plural count

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
public static CurrencyPluralInfo getInstance()

Gets a CurrencyPluralInfo instance for the default locale.

Returns:CurrencyPluralInfo

A CurrencyPluralInfo instance.

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
public static CurrencyPluralInfo getInstance(Locale locale)

Gets a CurrencyPluralInfo instance for the given locale.

Parameters
locale:Locale

the locale.

Returns:CurrencyPluralInfo

A CurrencyPluralInfo instance.

ICU Status
Stable since ICU 4.2.
getInstanceback to summary
public static CurrencyPluralInfo getInstance(ULocale locale)

Gets a CurrencyPluralInfo instance for the given locale.

Parameters
locale:ULocale

the locale.

Returns:CurrencyPluralInfo

A CurrencyPluralInfo instance.

ICU Status
Stable since ICU 4.2.
getLocaleback to summary
public ULocale getLocale()

Get locale

Returns:ULocale

locale

ICU Status
Stable since ICU 4.2.
getPluralRulesback to summary
public PluralRules getPluralRules()

Gets plural rules of this locale, used for currency plural format

Returns:PluralRules

plural rule

ICU Status
Stable since ICU 4.2.
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Override hashCode

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
ICU Status
Stable since ICU 4.2.
initializeback to summary
private void initialize(ULocale uloc)
pluralPatternIteratorback to summary
public Iterator<String> pluralPatternIterator()

Deprecated

This API is ICU internal only.

Currency plural pattern iterator.

Returns:Iterator<String>

a iterator on the currency plural pattern key set.

Annotations
@Deprecated
ICU Status
Internal ICU component.
selectback to summary
pack-priv String select(double number)

Deprecated

This API is ICU internal only.

Given a number, returns the keyword of the first rule that applies to the number.

Annotations
@Deprecated
ICU Status
Internal ICU component.
selectback to summary
public String select(PluralRules.FixedDecimal numberInfo)

Deprecated

This API is ICU internal only.

Given a number, returns the keyword of the first rule that applies to the number.

Annotations
@Deprecated
ICU Status
Internal ICU component.
setCurrencyPluralPatternback to summary
public void setCurrencyPluralPattern(String pluralCount, String pattern)

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

ICU Status
Stable since ICU 4.2.
setLocaleback to summary
public void setLocale(ULocale loc)

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

ICU Status
Stable since ICU 4.2.
setPluralRulesback to summary
public void setPluralRules(String ruleDescription)

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

ICU Status
Stable since ICU 4.2.
setupCurrencyPluralPatternback to summary
private void setupCurrencyPluralPattern(ULocale uloc)