# CurrencyPluralInfo Class Reference

This class represents the information needed by DecimalFormat to format currency plural, such as "3.00 US dollars" or "1.00 US dollar". More...

`#include <currpinf.h>`

Inheritance diagram for CurrencyPluralInfo:

## Public Member Functions
| CurrencyPluralInfo (UErrorCode &status)
| Create a CurrencyPluralInfo object for the default locale.
| CurrencyPluralInfo (const Locale &locale, UErrorCode &status)
| Create a CurrencyPluralInfo object for the given locale.
| CurrencyPluralInfo (const CurrencyPluralInfo &info)
| Copy constructor.
CurrencyPluralInfo & | operator= (const CurrencyPluralInfo &info)
| Assignment operator.
virtual | ~CurrencyPluralInfo ()
| Destructor.
UBool | operator== (const CurrencyPluralInfo &info) const
| Equal operator.
UBool | operator!= (const CurrencyPluralInfo &info) const
| Not equal operator.
CurrencyPluralInfo * | clone () const
| Clone.
const PluralRules * | getPluralRules () const
| Gets plural rules of this locale, used for currency plural format.
UnicodeString & | getCurrencyPluralPattern (const UnicodeString &pluralCount, UnicodeString &result) const
| Given a plural count, gets currency plural pattern of this locale, used for currency plural format.
const Locale & | getLocale () const
| Get locale.
void | setPluralRules (const UnicodeString &ruleDescription, UErrorCode &status)
| Set plural rules.
void | setCurrencyPluralPattern (const UnicodeString &pluralCount, const UnicodeString &pattern, UErrorCode &status)
| Set currency plural pattern.
void | setLocale (const Locale &loc, UErrorCode &status)
| Set locale.
virtual UClassID | getDynamicClassID () const
| ICU "poor man's RTTI", returns a UClassID for the actual class.
## Static Public Member Functions
static UClassID | getStaticClassID ()
| ICU "poor man's RTTI", returns a UClassID for this class.
## Friends
class | DecimalFormat

## Detailed Description

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.

Stable:
  ICU 4.2

Definition at line 46 of file currpinf.h.

## Constructor & Destructor Documentation

CurrencyPluralInfo::CurrencyPluralInfo | ( | UErrorCode & | status | ) |

Create a CurrencyPluralInfo object for the default locale.

Parameters:

  | status | output param set to success/failure code on exit

Stable:
  ICU 4.2

CurrencyPluralInfo::CurrencyPluralInfo | ( | const Locale & | locale,
|  | UErrorCode & | status |
| ) |  |  |

Create a CurrencyPluralInfo object for the given locale.

Parameters:

  | locale | the locale
  | status | output param set to success/failure code on exit

Stable:
  ICU 4.2

CurrencyPluralInfo::CurrencyPluralInfo | ( | const CurrencyPluralInfo & | info | ) |

Copy constructor.

Stable:
  ICU 4.2

virtual CurrencyPluralInfo::~CurrencyPluralInfo | ( |  | ) | `[virtual]`

Destructor.

Stable:
  ICU 4.2

## Member Function Documentation

CurrencyPluralInfo* CurrencyPluralInfo::clone | ( |  | ) | const

Clone.

Stable:
  ICU 4.2

UnicodeString& CurrencyPluralInfo::getCurrencyPluralPattern | ( | const UnicodeString & | pluralCount,
|  | UnicodeString & | result |
| ) |  |  | const

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

Parameters:

  | pluralCount | currency plural count
  | result | output param to receive the pattern

Returns:
  a currency plural pattern based on plural count

Stable:
  ICU 4.2

virtual UClassID CurrencyPluralInfo::getDynamicClassID | ( |  | ) | const`[virtual]`

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
  ICU 4.2

Implements UObject.

const Locale& CurrencyPluralInfo::getLocale | ( |  | ) | const

Get locale.

Returns:
  locale

Stable:
  ICU 4.2

const PluralRules* CurrencyPluralInfo::getPluralRules | ( |  | ) | const

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

Returns:
  plural rule

Stable:
  ICU 4.2

static UClassID CurrencyPluralInfo::getStaticClassID | ( |  | ) | `[static]`

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
  ICU 4.2

UBool CurrencyPluralInfo::operator!= | ( | const CurrencyPluralInfo & | info | ) | const`[inline]`

Not equal operator.

Stable:
  ICU 4.2

Definition at line 252 of file currpinf.h.

References operator==().

CurrencyPluralInfo& CurrencyPluralInfo::operator= | ( | const CurrencyPluralInfo & | info | ) |

Assignment operator.

Stable:
  ICU 4.2

UBool CurrencyPluralInfo::operator== | ( | const CurrencyPluralInfo & | info | ) | const

Equal operator.

Stable:
  ICU 4.2

Referenced by operator!=().

void CurrencyPluralInfo::setCurrencyPluralPattern | ( | const UnicodeString & | pluralCount,
|  | const UnicodeString & | pattern,
|  | UErrorCode & | status |
| ) |  |  |

Set currency plural pattern.

The currency plural pattern is set when CurrencyPluralInfo instance is created. You can call this method to reset currency plural pattern only if you want to modify the default currency plural pattern of the locale.

Parameters:

  | pluralCount | the plural count for which the currency pattern will be overridden.
  | pattern | the new currency plural pattern
  | status | output param set to success/failure code on exit

Stable:
  ICU 4.2

void CurrencyPluralInfo::setLocale | ( | const Locale & | loc,
|  | UErrorCode & | status |
| ) |  |  |

Set locale.

Parameters:

  | loc | the new locale to set
  | status | output param set to success/failure code on exit

Stable:
  ICU 4.2

void CurrencyPluralInfo::setPluralRules | ( | const UnicodeString & | ruleDescription,
|  | UErrorCode & | status |
| ) |  |  |

Set plural rules.

The plural rule is set when CurrencyPluralInfo instance is created. You can call this method to reset plural rules only if you want to modify the default plural rule of the locale.

Parameters:

  | ruleDescription | new plural rule description
  | status | output param set to success/failure code on exit

Stable:
  ICU 4.2

The documentation for this class was generated from the following file:

- currpinf.h

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines