00001 /* 00002 ********************************************************************** 00003 * Copyright (c) 2004-2006, International Business Machines 00004 * Corporation and others. All Rights Reserved. 00005 ********************************************************************** 00006 * Author: Alan Liu 00007 * Created: April 26, 2004 00008 * Since: ICU 3.0 00009 ********************************************************************** 00010 */ 00011 #ifndef __MEASURE_H__ 00012 #define __MEASURE_H__ 00013 00014 #include "unicode/utypes.h" 00015 00021 #if !UCONFIG_NO_FORMATTING 00022 00023 #include "unicode/fmtable.h" 00024 00025 U_NAMESPACE_BEGIN 00026 00027 class MeasureUnit; 00028 00045 class U_I18N_API Measure: public UObject { 00046 public: 00057 Measure(const Formattable& number, MeasureUnit* adoptedUnit, 00058 UErrorCode& ec); 00059 00064 Measure(const Measure& other); 00065 00070 Measure& operator=(const Measure& other); 00071 00077 virtual UObject* clone() const = 0; 00078 00083 virtual ~Measure(); 00084 00090 UBool operator==(const UObject& other) const; 00091 00098 inline const Formattable& getNumber() const; 00099 00104 inline const MeasureUnit& getUnit() const; 00105 00106 protected: 00111 Measure(); 00112 00113 private: 00117 Formattable number; 00118 00123 MeasureUnit* unit; 00124 }; 00125 00126 inline const Formattable& Measure::getNumber() const { 00127 return number; 00128 } 00129 00130 inline const MeasureUnit& Measure::getUnit() const { 00131 return *unit; 00132 } 00133 00134 U_NAMESPACE_END 00135 00136 #endif // !UCONFIG_NO_FORMATTING 00137 #endif // __MEASURE_H__