ICU 60.1  60.1
Public Member Functions | Static Public Member Functions | Friends
icu::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 icu::CurrencyPluralInfo:
icu::UObject icu::UMemory

Public Member Functions

 CurrencyPluralInfo (UErrorCode &status)
 Create a CurrencyPluralInfo object for the default locale. More...
 
 CurrencyPluralInfo (const Locale &locale, UErrorCode &status)
 Create a CurrencyPluralInfo object for the given locale. More...
 
 CurrencyPluralInfo (const CurrencyPluralInfo &info)
 Copy constructor. More...
 
CurrencyPluralInfooperator= (const CurrencyPluralInfo &info)
 Assignment operator. More...
 
virtual ~CurrencyPluralInfo ()
 Destructor. More...
 
UBool operator== (const CurrencyPluralInfo &info) const
 Equal operator. More...
 
UBool operator!= (const CurrencyPluralInfo &info) const
 Not equal operator. More...
 
CurrencyPluralInfoclone () const
 Clone. More...
 
const PluralRulesgetPluralRules () const
 Gets plural rules of this locale, used for currency plural format. More...
 
UnicodeStringgetCurrencyPluralPattern (const UnicodeString &pluralCount, UnicodeString &result) const
 Given a plural count, gets currency plural pattern of this locale, used for currency plural format. More...
 
const LocalegetLocale () const
 Get locale. More...
 
void setPluralRules (const UnicodeString &ruleDescription, UErrorCode &status)
 Set plural rules. More...
 
void setCurrencyPluralPattern (const UnicodeString &pluralCount, const UnicodeString &pattern, UErrorCode &status)
 Set currency plural pattern. More...
 
void setLocale (const Locale &loc, UErrorCode &status)
 Set locale. More...
 
virtual UClassID getDynamicClassID () const
 ICU "poor man's RTTI", returns a UClassID for the actual class. More...
 
- Public Member Functions inherited from icu::UObject
virtual ~UObject ()
 Destructor. More...
 

Static Public Member Functions

static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class. More...
 

Friends

class DecimalFormat
 
class DecimalFormatImpl
 

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() [1/3]

icu::CurrencyPluralInfo::CurrencyPluralInfo ( UErrorCode status)

Create a CurrencyPluralInfo object for the default locale.

Parameters
statusoutput param set to success/failure code on exit
Stable:
ICU 4.2

◆ CurrencyPluralInfo() [2/3]

icu::CurrencyPluralInfo::CurrencyPluralInfo ( const Locale locale,
UErrorCode status 
)

Create a CurrencyPluralInfo object for the given locale.

Parameters
localethe locale
statusoutput param set to success/failure code on exit
Stable:
ICU 4.2

◆ CurrencyPluralInfo() [3/3]

icu::CurrencyPluralInfo::CurrencyPluralInfo ( const CurrencyPluralInfo info)

Copy constructor.

Stable:
ICU 4.2

◆ ~CurrencyPluralInfo()

virtual icu::CurrencyPluralInfo::~CurrencyPluralInfo ( )
virtual

Destructor.

Stable:
ICU 4.2

Member Function Documentation

◆ clone()

CurrencyPluralInfo* icu::CurrencyPluralInfo::clone ( ) const

Clone.

Stable:
ICU 4.2

◆ getCurrencyPluralPattern()

UnicodeString& icu::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
pluralCountcurrency plural count
resultoutput param to receive the pattern
Returns
a currency plural pattern based on plural count
Stable:
ICU 4.2

◆ getDynamicClassID()

virtual UClassID icu::CurrencyPluralInfo::getDynamicClassID ( ) const
virtual

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

Stable:
ICU 4.2

Reimplemented from icu::UObject.

◆ getLocale()

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

Get locale.

Returns
locale
Stable:
ICU 4.2

◆ getPluralRules()

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

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

Returns
plural rule
Stable:
ICU 4.2

◆ getStaticClassID()

static UClassID icu::CurrencyPluralInfo::getStaticClassID ( )
static

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

Stable:
ICU 4.2

◆ operator!=()

UBool icu::CurrencyPluralInfo::operator!= ( const CurrencyPluralInfo info) const
inline

Not equal operator.

Stable:
ICU 4.2

Definition at line 254 of file currpinf.h.

References icu::operator==(), and U_NAMESPACE_END.

◆ operator=()

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

Assignment operator.

Stable:
ICU 4.2

◆ operator==()

UBool icu::CurrencyPluralInfo::operator== ( const CurrencyPluralInfo info) const

Equal operator.

Stable:
ICU 4.2

◆ setCurrencyPluralPattern()

void icu::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
pluralCountthe plural count for which the currency pattern will be overridden.
patternthe new currency plural pattern
statusoutput param set to success/failure code on exit
Stable:
ICU 4.2

◆ setLocale()

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

Set locale.

Parameters
locthe new locale to set
statusoutput param set to success/failure code on exit
Stable:
ICU 4.2

◆ setPluralRules()

void icu::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
ruleDescriptionnew plural rule description
statusoutput param set to success/failure code on exit
Stable:
ICU 4.2

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