00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ********************************************************************** 00005 * Copyright (c) 2004-2015, International Business Machines 00006 * Corporation and others. All Rights Reserved. 00007 ********************************************************************** 00008 * Author: Alan Liu 00009 * Created: April 26, 2004 00010 * Since: ICU 3.0 00011 ********************************************************************** 00012 */ 00013 #ifndef __MEASURE_H__ 00014 #define __MEASURE_H__ 00015 00016 #include "unicode/utypes.h" 00017 00023 #if !UCONFIG_NO_FORMATTING 00024 00025 #include "unicode/fmtable.h" 00026 00027 U_NAMESPACE_BEGIN 00028 00029 class MeasureUnit; 00030 00043 class U_I18N_API Measure: public UObject { 00044 public: 00055 Measure(const Formattable& number, MeasureUnit* adoptedUnit, 00056 UErrorCode& ec); 00057 00062 Measure(const Measure& other); 00063 00068 Measure& operator=(const Measure& other); 00069 00075 virtual UObject* clone() const; 00076 00081 virtual ~Measure(); 00082 00088 UBool operator==(const UObject& other) const; 00089 00096 inline const Formattable& getNumber() const; 00097 00102 inline const MeasureUnit& getUnit() const; 00103 00115 static UClassID U_EXPORT2 getStaticClassID(void); 00116 00128 virtual UClassID getDynamicClassID(void) const; 00129 00130 protected: 00135 Measure(); 00136 00137 private: 00141 Formattable number; 00142 00147 MeasureUnit* unit; 00148 }; 00149 00150 inline const Formattable& Measure::getNumber() const { 00151 return number; 00152 } 00153 00154 inline const MeasureUnit& Measure::getUnit() const { 00155 return *unit; 00156 } 00157 00158 U_NAMESPACE_END 00159 00160 #endif // !UCONFIG_NO_FORMATTING 00161 #endif // __MEASURE_H__
1.6.1