00001 /* 00002 ********************************************************************** 00003 * Copyright (c) 2004-2015, 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 00041 class U_I18N_API Measure: public UObject { 00042 public: 00053 Measure(const Formattable& number, MeasureUnit* adoptedUnit, 00054 UErrorCode& ec); 00055 00060 Measure(const Measure& other); 00061 00066 Measure& operator=(const Measure& other); 00067 00073 virtual UObject* clone() const; 00074 00079 virtual ~Measure(); 00080 00086 UBool operator==(const UObject& other) const; 00087 00094 inline const Formattable& getNumber() const; 00095 00100 inline const MeasureUnit& getUnit() const; 00101 00113 static UClassID U_EXPORT2 getStaticClassID(void); 00114 00126 virtual UClassID getDynamicClassID(void) const; 00127 00128 protected: 00133 Measure(); 00134 00135 private: 00139 Formattable number; 00140 00145 MeasureUnit* unit; 00146 }; 00147 00148 inline const Formattable& Measure::getNumber() const { 00149 return number; 00150 } 00151 00152 inline const MeasureUnit& Measure::getUnit() const { 00153 return *unit; 00154 } 00155 00156 U_NAMESPACE_END 00157 00158 #endif // !UCONFIG_NO_FORMATTING 00159 #endif // __MEASURE_H__
1.6.1