ICU 58.2  58.2
Public Member Functions | Static Public Member Functions
icu::CurrencyUnit Class Reference

A unit of currency, such as USD (U.S. More...

#include <currunit.h>

Inheritance diagram for icu::CurrencyUnit:
icu::MeasureUnit icu::UObject icu::UMemory

Public Member Functions

 CurrencyUnit (const UChar *isoCode, UErrorCode &ec)
 Construct an object with the given ISO currency code. More...
 
 CurrencyUnit (const CurrencyUnit &other)
 Copy constructor. More...
 
CurrencyUnitoperator= (const CurrencyUnit &other)
 Assignment operator. More...
 
virtual UObjectclone () const
 Return a polymorphic clone of this object. More...
 
virtual ~CurrencyUnit ()
 Destructor. More...
 
virtual UClassID getDynamicClassID () const
 Returns a unique class ID for this object POLYMORPHICALLY. More...
 
const UChargetISOCurrency () const
 Return the ISO currency code of this object. More...
 
- Public Member Functions inherited from icu::MeasureUnit
 MeasureUnit ()
 Default constructor. More...
 
 MeasureUnit (const MeasureUnit &other)
 Copy constructor. More...
 
MeasureUnitoperator= (const MeasureUnit &other)
 Assignment operator. More...
 
virtual ~MeasureUnit ()
 Destructor. More...
 
virtual UBool operator== (const UObject &other) const
 Equality operator. More...
 
UBool operator!= (const UObject &other) const
 Inequality operator. More...
 
const char * getType () const
 Get the type. More...
 
const char * getSubtype () const
 Get the sub type. More...
 
int32_t getIndex () const
 ICU use only. More...
 
- Public Member Functions inherited from icu::UObject
virtual ~UObject ()
 Destructor. More...
 

Static Public Member Functions

static UClassID getStaticClassID ()
 Returns the class ID for this class. More...
 
- Static Public Member Functions inherited from icu::MeasureUnit
static int32_t getAvailable (MeasureUnit *destArray, int32_t destCapacity, UErrorCode &errorCode)
 getAvailable gets all of the available units. More...
 
static int32_t getAvailable (const char *type, MeasureUnit *destArray, int32_t destCapacity, UErrorCode &errorCode)
 getAvailable gets all of the available units for a specific type. More...
 
static StringEnumerationgetAvailableTypes (UErrorCode &errorCode)
 getAvailableTypes gets all of the available types. More...
 
static UClassID getStaticClassID (void)
 Return the class ID for this class. More...
 
static int32_t getIndexCount ()
 ICU use only. More...
 
static int32_t internalGetIndexForTypeAndSubtype (const char *type, const char *subtype)
 ICU use only. More...
 
static MeasureUnitresolveUnitPerUnit (const MeasureUnit &unit, const MeasureUnit &perUnit)
 ICU use only. More...
 
static MeasureUnitcreateGForce (UErrorCode &status)
 Returns unit of acceleration: g-force. More...
 
static MeasureUnitcreateMeterPerSecondSquared (UErrorCode &status)
 Returns unit of acceleration: meter-per-second-squared. More...
 
static MeasureUnitcreateArcMinute (UErrorCode &status)
 Returns unit of angle: arc-minute. More...
 
static MeasureUnitcreateArcSecond (UErrorCode &status)
 Returns unit of angle: arc-second. More...
 
static MeasureUnitcreateDegree (UErrorCode &status)
 Returns unit of angle: degree. More...
 
static MeasureUnitcreateRadian (UErrorCode &status)
 Returns unit of angle: radian. More...
 
static MeasureUnitcreateRevolutionAngle (UErrorCode &status)
 Returns unit of angle: revolution. More...
 
static MeasureUnitcreateAcre (UErrorCode &status)
 Returns unit of area: acre. More...
 
static MeasureUnitcreateHectare (UErrorCode &status)
 Returns unit of area: hectare. More...
 
static MeasureUnitcreateSquareCentimeter (UErrorCode &status)
 Returns unit of area: square-centimeter. More...
 
static MeasureUnitcreateSquareFoot (UErrorCode &status)
 Returns unit of area: square-foot. More...
 
static MeasureUnitcreateSquareInch (UErrorCode &status)
 Returns unit of area: square-inch. More...
 
static MeasureUnitcreateSquareKilometer (UErrorCode &status)
 Returns unit of area: square-kilometer. More...
 
static MeasureUnitcreateSquareMeter (UErrorCode &status)
 Returns unit of area: square-meter. More...
 
static MeasureUnitcreateSquareMile (UErrorCode &status)
 Returns unit of area: square-mile. More...
 
static MeasureUnitcreateSquareYard (UErrorCode &status)
 Returns unit of area: square-yard. More...
 
static MeasureUnitcreateKarat (UErrorCode &status)
 Returns unit of concentr: karat. More...
 
static MeasureUnitcreateMilligramPerDeciliter (UErrorCode &status)
 Returns unit of concentr: milligram-per-deciliter. More...
 
static MeasureUnitcreateMillimolePerLiter (UErrorCode &status)
 Returns unit of concentr: millimole-per-liter. More...
 
static MeasureUnitcreatePartPerMillion (UErrorCode &status)
 Returns unit of concentr: part-per-million. More...
 
static MeasureUnitcreateLiterPer100Kilometers (UErrorCode &status)
 Returns unit of consumption: liter-per-100kilometers. More...
 
static MeasureUnitcreateLiterPerKilometer (UErrorCode &status)
 Returns unit of consumption: liter-per-kilometer. More...
 
static MeasureUnitcreateMilePerGallon (UErrorCode &status)
 Returns unit of consumption: mile-per-gallon. More...
 
static MeasureUnitcreateMilePerGallonImperial (UErrorCode &status)
 Returns unit of consumption: mile-per-gallon-imperial. More...
 
static MeasureUnitcreateEast (UErrorCode &status)
 Returns unit of coordinate: east. More...
 
static MeasureUnitcreateNorth (UErrorCode &status)
 Returns unit of coordinate: north. More...
 
static MeasureUnitcreateSouth (UErrorCode &status)
 Returns unit of coordinate: south. More...
 
static MeasureUnitcreateWest (UErrorCode &status)
 Returns unit of coordinate: west. More...
 
static MeasureUnitcreateBit (UErrorCode &status)
 Returns unit of digital: bit. More...
 
static MeasureUnitcreateByte (UErrorCode &status)
 Returns unit of digital: byte. More...
 
static MeasureUnitcreateGigabit (UErrorCode &status)
 Returns unit of digital: gigabit. More...
 
static MeasureUnitcreateGigabyte (UErrorCode &status)
 Returns unit of digital: gigabyte. More...
 
static MeasureUnitcreateKilobit (UErrorCode &status)
 Returns unit of digital: kilobit. More...
 
static MeasureUnitcreateKilobyte (UErrorCode &status)
 Returns unit of digital: kilobyte. More...
 
static MeasureUnitcreateMegabit (UErrorCode &status)
 Returns unit of digital: megabit. More...
 
static MeasureUnitcreateMegabyte (UErrorCode &status)
 Returns unit of digital: megabyte. More...
 
static MeasureUnitcreateTerabit (UErrorCode &status)
 Returns unit of digital: terabit. More...
 
static MeasureUnitcreateTerabyte (UErrorCode &status)
 Returns unit of digital: terabyte. More...
 
static MeasureUnitcreateCentury (UErrorCode &status)
 Returns unit of duration: century. More...
 
static MeasureUnitcreateDay (UErrorCode &status)
 Returns unit of duration: day. More...
 
static MeasureUnitcreateHour (UErrorCode &status)
 Returns unit of duration: hour. More...
 
static MeasureUnitcreateMicrosecond (UErrorCode &status)
 Returns unit of duration: microsecond. More...
 
static MeasureUnitcreateMillisecond (UErrorCode &status)
 Returns unit of duration: millisecond. More...
 
static MeasureUnitcreateMinute (UErrorCode &status)
 Returns unit of duration: minute. More...
 
static MeasureUnitcreateMonth (UErrorCode &status)
 Returns unit of duration: month. More...
 
static MeasureUnitcreateNanosecond (UErrorCode &status)
 Returns unit of duration: nanosecond. More...
 
static MeasureUnitcreateSecond (UErrorCode &status)
 Returns unit of duration: second. More...
 
static MeasureUnitcreateWeek (UErrorCode &status)
 Returns unit of duration: week. More...
 
static MeasureUnitcreateYear (UErrorCode &status)
 Returns unit of duration: year. More...
 
static MeasureUnitcreateAmpere (UErrorCode &status)
 Returns unit of electric: ampere. More...
 
static MeasureUnitcreateMilliampere (UErrorCode &status)
 Returns unit of electric: milliampere. More...
 
static MeasureUnitcreateOhm (UErrorCode &status)
 Returns unit of electric: ohm. More...
 
static MeasureUnitcreateVolt (UErrorCode &status)
 Returns unit of electric: volt. More...
 
static MeasureUnitcreateCalorie (UErrorCode &status)
 Returns unit of energy: calorie. More...
 
static MeasureUnitcreateFoodcalorie (UErrorCode &status)
 Returns unit of energy: foodcalorie. More...
 
static MeasureUnitcreateJoule (UErrorCode &status)
 Returns unit of energy: joule. More...
 
static MeasureUnitcreateKilocalorie (UErrorCode &status)
 Returns unit of energy: kilocalorie. More...
 
static MeasureUnitcreateKilojoule (UErrorCode &status)
 Returns unit of energy: kilojoule. More...
 
static MeasureUnitcreateKilowattHour (UErrorCode &status)
 Returns unit of energy: kilowatt-hour. More...
 
static MeasureUnitcreateGigahertz (UErrorCode &status)
 Returns unit of frequency: gigahertz. More...
 
static MeasureUnitcreateHertz (UErrorCode &status)
 Returns unit of frequency: hertz. More...
 
static MeasureUnitcreateKilohertz (UErrorCode &status)
 Returns unit of frequency: kilohertz. More...
 
static MeasureUnitcreateMegahertz (UErrorCode &status)
 Returns unit of frequency: megahertz. More...
 
static MeasureUnitcreateAstronomicalUnit (UErrorCode &status)
 Returns unit of length: astronomical-unit. More...
 
static MeasureUnitcreateCentimeter (UErrorCode &status)
 Returns unit of length: centimeter. More...
 
static MeasureUnitcreateDecimeter (UErrorCode &status)
 Returns unit of length: decimeter. More...
 
static MeasureUnitcreateFathom (UErrorCode &status)
 Returns unit of length: fathom. More...
 
static MeasureUnitcreateFoot (UErrorCode &status)
 Returns unit of length: foot. More...
 
static MeasureUnitcreateFurlong (UErrorCode &status)
 Returns unit of length: furlong. More...
 
static MeasureUnitcreateInch (UErrorCode &status)
 Returns unit of length: inch. More...
 
static MeasureUnitcreateKilometer (UErrorCode &status)
 Returns unit of length: kilometer. More...
 
static MeasureUnitcreateLightYear (UErrorCode &status)
 Returns unit of length: light-year. More...
 
static MeasureUnitcreateMeter (UErrorCode &status)
 Returns unit of length: meter. More...
 
static MeasureUnitcreateMicrometer (UErrorCode &status)
 Returns unit of length: micrometer. More...
 
static MeasureUnitcreateMile (UErrorCode &status)
 Returns unit of length: mile. More...
 
static MeasureUnitcreateMileScandinavian (UErrorCode &status)
 Returns unit of length: mile-scandinavian. More...
 
static MeasureUnitcreateMillimeter (UErrorCode &status)
 Returns unit of length: millimeter. More...
 
static MeasureUnitcreateNanometer (UErrorCode &status)
 Returns unit of length: nanometer. More...
 
static MeasureUnitcreateNauticalMile (UErrorCode &status)
 Returns unit of length: nautical-mile. More...
 
static MeasureUnitcreateParsec (UErrorCode &status)
 Returns unit of length: parsec. More...
 
static MeasureUnitcreatePicometer (UErrorCode &status)
 Returns unit of length: picometer. More...
 
static MeasureUnitcreateYard (UErrorCode &status)
 Returns unit of length: yard. More...
 
static MeasureUnitcreateLux (UErrorCode &status)
 Returns unit of light: lux. More...
 
static MeasureUnitcreateCarat (UErrorCode &status)
 Returns unit of mass: carat. More...
 
static MeasureUnitcreateGram (UErrorCode &status)
 Returns unit of mass: gram. More...
 
static MeasureUnitcreateKilogram (UErrorCode &status)
 Returns unit of mass: kilogram. More...
 
static MeasureUnitcreateMetricTon (UErrorCode &status)
 Returns unit of mass: metric-ton. More...
 
static MeasureUnitcreateMicrogram (UErrorCode &status)
 Returns unit of mass: microgram. More...
 
static MeasureUnitcreateMilligram (UErrorCode &status)
 Returns unit of mass: milligram. More...
 
static MeasureUnitcreateOunce (UErrorCode &status)
 Returns unit of mass: ounce. More...
 
static MeasureUnitcreateOunceTroy (UErrorCode &status)
 Returns unit of mass: ounce-troy. More...
 
static MeasureUnitcreatePound (UErrorCode &status)
 Returns unit of mass: pound. More...
 
static MeasureUnitcreateStone (UErrorCode &status)
 Returns unit of mass: stone. More...
 
static MeasureUnitcreateTon (UErrorCode &status)
 Returns unit of mass: ton. More...
 
static MeasureUnitcreateGigawatt (UErrorCode &status)
 Returns unit of power: gigawatt. More...
 
static MeasureUnitcreateHorsepower (UErrorCode &status)
 Returns unit of power: horsepower. More...
 
static MeasureUnitcreateKilowatt (UErrorCode &status)
 Returns unit of power: kilowatt. More...
 
static MeasureUnitcreateMegawatt (UErrorCode &status)
 Returns unit of power: megawatt. More...
 
static MeasureUnitcreateMilliwatt (UErrorCode &status)
 Returns unit of power: milliwatt. More...
 
static MeasureUnitcreateWatt (UErrorCode &status)
 Returns unit of power: watt. More...
 
static MeasureUnitcreateHectopascal (UErrorCode &status)
 Returns unit of pressure: hectopascal. More...
 
static MeasureUnitcreateInchHg (UErrorCode &status)
 Returns unit of pressure: inch-hg. More...
 
static MeasureUnitcreateMillibar (UErrorCode &status)
 Returns unit of pressure: millibar. More...
 
static MeasureUnitcreateMillimeterOfMercury (UErrorCode &status)
 Returns unit of pressure: millimeter-of-mercury. More...
 
static MeasureUnitcreatePoundPerSquareInch (UErrorCode &status)
 Returns unit of pressure: pound-per-square-inch. More...
 
static MeasureUnitcreateKilometerPerHour (UErrorCode &status)
 Returns unit of speed: kilometer-per-hour. More...
 
static MeasureUnitcreateKnot (UErrorCode &status)
 Returns unit of speed: knot. More...
 
static MeasureUnitcreateMeterPerSecond (UErrorCode &status)
 Returns unit of speed: meter-per-second. More...
 
static MeasureUnitcreateMilePerHour (UErrorCode &status)
 Returns unit of speed: mile-per-hour. More...
 
static MeasureUnitcreateCelsius (UErrorCode &status)
 Returns unit of temperature: celsius. More...
 
static MeasureUnitcreateFahrenheit (UErrorCode &status)
 Returns unit of temperature: fahrenheit. More...
 
static MeasureUnitcreateGenericTemperature (UErrorCode &status)
 Returns unit of temperature: generic. More...
 
static MeasureUnitcreateKelvin (UErrorCode &status)
 Returns unit of temperature: kelvin. More...
 
static MeasureUnitcreateAcreFoot (UErrorCode &status)
 Returns unit of volume: acre-foot. More...
 
static MeasureUnitcreateBushel (UErrorCode &status)
 Returns unit of volume: bushel. More...
 
static MeasureUnitcreateCentiliter (UErrorCode &status)
 Returns unit of volume: centiliter. More...
 
static MeasureUnitcreateCubicCentimeter (UErrorCode &status)
 Returns unit of volume: cubic-centimeter. More...
 
static MeasureUnitcreateCubicFoot (UErrorCode &status)
 Returns unit of volume: cubic-foot. More...
 
static MeasureUnitcreateCubicInch (UErrorCode &status)
 Returns unit of volume: cubic-inch. More...
 
static MeasureUnitcreateCubicKilometer (UErrorCode &status)
 Returns unit of volume: cubic-kilometer. More...
 
static MeasureUnitcreateCubicMeter (UErrorCode &status)
 Returns unit of volume: cubic-meter. More...
 
static MeasureUnitcreateCubicMile (UErrorCode &status)
 Returns unit of volume: cubic-mile. More...
 
static MeasureUnitcreateCubicYard (UErrorCode &status)
 Returns unit of volume: cubic-yard. More...
 
static MeasureUnitcreateCup (UErrorCode &status)
 Returns unit of volume: cup. More...
 
static MeasureUnitcreateCupMetric (UErrorCode &status)
 Returns unit of volume: cup-metric. More...
 
static MeasureUnitcreateDeciliter (UErrorCode &status)
 Returns unit of volume: deciliter. More...
 
static MeasureUnitcreateFluidOunce (UErrorCode &status)
 Returns unit of volume: fluid-ounce. More...
 
static MeasureUnitcreateGallon (UErrorCode &status)
 Returns unit of volume: gallon. More...
 
static MeasureUnitcreateGallonImperial (UErrorCode &status)
 Returns unit of volume: gallon-imperial. More...
 
static MeasureUnitcreateHectoliter (UErrorCode &status)
 Returns unit of volume: hectoliter. More...
 
static MeasureUnitcreateLiter (UErrorCode &status)
 Returns unit of volume: liter. More...
 
static MeasureUnitcreateMegaliter (UErrorCode &status)
 Returns unit of volume: megaliter. More...
 
static MeasureUnitcreateMilliliter (UErrorCode &status)
 Returns unit of volume: milliliter. More...
 
static MeasureUnitcreatePint (UErrorCode &status)
 Returns unit of volume: pint. More...
 
static MeasureUnitcreatePintMetric (UErrorCode &status)
 Returns unit of volume: pint-metric. More...
 
static MeasureUnitcreateQuart (UErrorCode &status)
 Returns unit of volume: quart. More...
 
static MeasureUnitcreateTablespoon (UErrorCode &status)
 Returns unit of volume: tablespoon. More...
 
static MeasureUnitcreateTeaspoon (UErrorCode &status)
 Returns unit of volume: teaspoon. More...
 

Additional Inherited Members

- Protected Member Functions inherited from icu::MeasureUnit
void initTime (const char *timeId)
 For ICU use only. More...
 
void initCurrency (const char *isoCurrency)
 For ICU use only. More...
 

Detailed Description

A unit of currency, such as USD (U.S.

dollars) or JPY (Japanese yen). This class is a thin wrapper over a UChar string that subclasses MeasureUnit, for use with Measure and MeasureFormat.

Author
Alan Liu
Stable:
ICU 3.0

Definition at line 37 of file currunit.h.

Constructor & Destructor Documentation

icu::CurrencyUnit::CurrencyUnit ( const UChar isoCode,
UErrorCode ec 
)

Construct an object with the given ISO currency code.

Parameters
isoCodethe 3-letter ISO 4217 currency code; must not be NULL and must have length 3
ecinput-output error code. If the isoCode is invalid, then this will be set to a failing value.
Stable:
ICU 3.0
icu::CurrencyUnit::CurrencyUnit ( const CurrencyUnit other)

Copy constructor.

Stable:
ICU 3.0
virtual icu::CurrencyUnit::~CurrencyUnit ( )
virtual

Destructor.

Stable:
ICU 3.0

Member Function Documentation

virtual UObject* icu::CurrencyUnit::clone ( ) const
virtual

Return a polymorphic clone of this object.

The result will have the same class as returned by getDynamicClassID().

Stable:
ICU 3.0

Reimplemented from icu::MeasureUnit.

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

Returns a unique class ID for this object POLYMORPHICALLY.

This method implements a simple form of RTTI used by ICU.

Returns
The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs.
Stable:
ICU 3.0

Reimplemented from icu::MeasureUnit.

const UChar * icu::CurrencyUnit::getISOCurrency ( ) const
inline

Return the ISO currency code of this object.

Stable:
ICU 3.0

Definition at line 105 of file currunit.h.

References U_NAMESPACE_END.

static UClassID icu::CurrencyUnit::getStaticClassID ( )
static

Returns the class ID for this class.

This is used to compare to the return value of getDynamicClassID().

Returns
The class ID for all objects of this class.
Stable:
ICU 3.0
CurrencyUnit& icu::CurrencyUnit::operator= ( const CurrencyUnit other)

Assignment operator.

Stable:
ICU 3.0

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