measure.h

00001 /*
00002 **********************************************************************
00003 * Copyright (c) 2004, 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 
00016 #if !UCONFIG_NO_FORMATTING
00017 
00018 #include "unicode/fmtable.h"
00019 
00020 U_NAMESPACE_BEGIN
00021 
00022 class MeasureUnit;
00023 
00040 class U_I18N_API Measure: public UObject {
00041  public:
00052     Measure(const Formattable& number, MeasureUnit* adoptedUnit,
00053             UErrorCode& ec);
00054 
00059     Measure(const Measure& other);
00060 
00065     Measure& operator=(const Measure& other);
00066 
00072     virtual UObject* clone() const = 0;
00073 
00078     virtual ~Measure();
00079     
00085     UBool operator==(const UObject& other) const;
00086 
00093     inline const Formattable& getNumber() const;
00094 
00099     inline const MeasureUnit& getUnit() const;
00100 
00101  protected:
00106     Measure();
00107 
00108  private:
00112     Formattable number;
00113 
00118     MeasureUnit* unit;
00119 };
00120 
00121 inline const Formattable& Measure::getNumber() const {
00122     return number;
00123 }
00124 
00125 inline const MeasureUnit& Measure::getUnit() const {
00126     return *unit;
00127 }
00128 
00129 U_NAMESPACE_END
00130 
00131 #endif // !UCONFIG_NO_FORMATTING
00132 #endif // __MEASURE_H__

Generated on Tue Nov 16 10:03:05 2004 for ICU 3.2 by  doxygen 1.3.9.1