class Measure

Defined at line 45 of file ../../third_party/icu/latest/source/i18n/unicode/measure.h

An amount of a specified unit, consisting of a number and a Unit.

For example, a length measure consists of a number and a length

unit, such as feet or meters.

Measure objects are formatted by MeasureFormat.

Measure objects are immutable.

Public Methods

void Measure (const Formattable & number, MeasureUnit * adoptedUnit, UErrorCode & ec)

Construct an object with the given numeric amount and the given

unit. After this call, the caller must not delete the given

unit object.

Parameters

number a numeric object; amount.isNumeric() must be true
adoptedUnit the unit object, which must not be nullptr
ec input-output error code. If the amount or the unit is invalid, then this will be set to a failing value. ICU 3.0
void Measure (const Measure & other)

Copy constructor

ICU 3.0

Measure & operator= (const Measure & other)

Assignment operator

ICU 3.0

Measure * clone ()

Return a polymorphic clone of this object. The result will

have the same class as returned by getDynamicClassID().

ICU 3.0

bool operator!= (const UObject & other)

Inequality operator. Returns true if this object is not equal to the other object.

Parameters

other the object to compare with

Returns

true if the objects are not equal

ICU 74

Defined at line 98 of file ../../third_party/icu/latest/source/i18n/unicode/measure.h

void ~Measure ()

Destructor

ICU 3.0

bool operator== (const UObject & other)

Equality operator. Return true if this object is equal

to the given object.

ICU 3.0

const Formattable & getNumber ()

Return a reference to the numeric value of this object. The

numeric value may be of any numeric type supported by

Formattable.

ICU 3.0

Defined at line 160 of file ../../third_party/icu/latest/source/i18n/unicode/measure.h

const MeasureUnit & getUnit ()

Return a reference to the unit of this object.

ICU 3.0

Defined at line 164 of file ../../third_party/icu/latest/source/i18n/unicode/measure.h

UClassID getStaticClassID ()

Return the class ID for this class. This is useful only for comparing to

a return value from getDynamicClassID(). For example:

. Base* polymorphic_pointer = createPolymorphicObject();

. if (polymorphic_pointer->getDynamicClassID() ==

. erived::getStaticClassID()) ...

Returns

The class ID for all objects of this class.

ICU 53

UClassID getDynamicClassID ()

Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This

method is to implement a simple version of RTTI, since not all C++

compilers support genuine RTTI. Polymorphic operator==() and clone()

methods call this method.

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.

ICU 53

Protected Methods

void Measure ()

Default constructor.

ICU 3.0