<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ICU 3.8: Measure Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.1 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li id="current"><a href="classes.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label> <u>S</u>earch for </label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul></div> <div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul></div> <h1>Measure Class Reference</h1><!-- doxytag: class="Measure" --><!-- doxytag: inherits="UObject" -->An amount of a specified unit, consisting of a number and a Unit. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="measure_8h-source.html">measure.h</a>></code> <p> <p>Inheritance diagram for Measure: <p><center><img src="classMeasure.png" usemap="#Measure_map" border="0" alt=""></center> <map name="Measure_map"> <area href="classUObject.html" alt="UObject" shape="rect" coords="0,56,108,80"> <area href="classUMemory.html" alt="UMemory" shape="rect" coords="0,0,108,24"> <area href="classCurrencyAmount.html" alt="CurrencyAmount" shape="rect" coords="0,168,108,192"> </map> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#46a388e186c1f6f60ad39202ad2ac2ef">Measure</a> (const <a class="el" href="classFormattable.html">Formattable</a> &number, <a class="el" href="classMeasureUnit.html">MeasureUnit</a> *adoptedUnit, <a class="el" href="utypes_8h.html#3343c1c8a8377277046774691c98d78c">UErrorCode</a> &ec)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an object with the given numeric amount and the given unit. <a href="#46a388e186c1f6f60ad39202ad2ac2ef"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#6860501b4d4b500d019877473ff0ad61">Measure</a> (const <a class="el" href="classMeasure.html">Measure</a> &other)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <a href="#6860501b4d4b500d019877473ff0ad61"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classMeasure.html">Measure</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#94221e3ffde5706e1f28e0a558f34981">operator=</a> (const <a class="el" href="classMeasure.html">Measure</a> &other)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Assignment operator. <a href="#94221e3ffde5706e1f28e0a558f34981"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classUObject.html">UObject</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#4b0820ab8159e564c1879d30f389b714">clone</a> () const=0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return a polymorphic clone of this object. <a href="#4b0820ab8159e564c1879d30f389b714"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#6af10081ceb2f0850e74aec7202669a2">~Measure</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#6af10081ceb2f0850e74aec7202669a2"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="umachine_8h.html#349ef00011f20ccd1d3b424445681aa5">UBool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#12a125d7259801aa8f040eed0e424c0d">operator==</a> (const <a class="el" href="classUObject.html">UObject</a> &other) const</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Equality operator. <a href="#12a125d7259801aa8f040eed0e424c0d"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classFormattable.html">Formattable</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#ab92958c1b03f04c426fe1c021801287">getNumber</a> () const</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return a reference to the numeric value of this object. <a href="#ab92958c1b03f04c426fe1c021801287"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classMeasureUnit.html">MeasureUnit</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#41d0d155a1db01bcc1547497aeebfeac">getUnit</a> () const</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return a reference to the unit of this object. <a href="#41d0d155a1db01bcc1547497aeebfeac"></a><br></td></tr> <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classMeasure.html#b55c93d6121f43c91a337fb7bcd26825">Measure</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#b55c93d6121f43c91a337fb7bcd26825"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> An amount of a specified unit, consisting of a number and a Unit. <p> For example, a length measure consists of a number and a length unit, such as feet or meters. This is an abstract class. Subclasses specify a concrete Unit type.<p> <a class="el" href="classMeasure.html">Measure</a> objects are parsed and formatted by subclasses of <a class="el" href="classMeasureFormat.html">MeasureFormat</a>.<p> <a class="el" href="classMeasure.html">Measure</a> objects are immutable.<p> This is an abstract class.<p> <dl class="author" compact><dt><b>Author:</b></dt><dd>Alan Liu </dd></dl> <dl compact><dt><b><a class="el" href="stable.html#_stable002476">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p> <p> Definition at line <a class="el" href="measure_8h-source.html#l00045">45</a> of file <a class="el" href="measure_8h-source.html">measure.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="46a388e186c1f6f60ad39202ad2ac2ef"></a><!-- doxytag: member="Measure::Measure" ref="46a388e186c1f6f60ad39202ad2ac2ef" args="(const Formattable &number, MeasureUnit *adoptedUnit, UErrorCode &ec)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Measure::Measure </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFormattable.html">Formattable</a> & </td> <td class="paramname"> <em>number</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMeasureUnit.html">MeasureUnit</a> * </td> <td class="paramname"> <em>adoptedUnit</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td> <td class="paramname"> <em>ec</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Construct an object with the given numeric amount and the given unit. <p> After this call, the caller must not delete the given unit object. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>number</em> </td><td>a numeric object; amount.isNumeric() must be TRUE </td></tr> <tr><td valign="top"></td><td valign="top"><em>adoptedUnit</em> </td><td>the unit object, which must not be NULL </td></tr> <tr><td valign="top"></td><td valign="top"><em>ec</em> </td><td>input-output error code. If the amount or the unit is invalid, then this will be set to a failing value. </td></tr> </table> </dl> <dl compact><dt><b><a class="el" href="stable.html#_stable002477">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div><p> <a class="anchor" name="6860501b4d4b500d019877473ff0ad61"></a><!-- doxytag: member="Measure::Measure" ref="6860501b4d4b500d019877473ff0ad61" args="(const Measure &other)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Measure::Measure </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMeasure.html">Measure</a> & </td> <td class="paramname"> <em>other</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Copy constructor. <p> <dl compact><dt><b><a class="el" href="stable.html#_stable002478">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div><p> <a class="anchor" name="6af10081ceb2f0850e74aec7202669a2"></a><!-- doxytag: member="Measure::~Measure" ref="6af10081ceb2f0850e74aec7202669a2" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual Measure::~Measure </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Destructor. <p> <dl compact><dt><b><a class="el" href="stable.html#_stable002481">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div><p> <a class="anchor" name="b55c93d6121f43c91a337fb7bcd26825"></a><!-- doxytag: member="Measure::Measure" ref="b55c93d6121f43c91a337fb7bcd26825" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Measure::Measure </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Default constructor. <p> <dl compact><dt><b><a class="el" href="stable.html#_stable002485">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="94221e3ffde5706e1f28e0a558f34981"></a><!-- doxytag: member="Measure::operator=" ref="94221e3ffde5706e1f28e0a558f34981" args="(const Measure &other)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMeasure.html">Measure</a>& Measure::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMeasure.html">Measure</a> & </td> <td class="paramname"> <em>other</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Assignment operator. <p> <dl compact><dt><b><a class="el" href="stable.html#_stable002479">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div><p> <a class="anchor" name="4b0820ab8159e564c1879d30f389b714"></a><!-- doxytag: member="Measure::clone" ref="4b0820ab8159e564c1879d30f389b714" args="() const=0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classUObject.html">UObject</a>* Measure::clone </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return a polymorphic clone of this object. <p> The result will have the same class as returned by <a class="el" href="classUObject.html#ce1dd31fb2c6f2c07dfebe8fd240ec37">getDynamicClassID()</a>. <dl compact><dt><b><a class="el" href="stable.html#_stable002480">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p> Implemented in <a class="el" href="classCurrencyAmount.html#5d5eb966d8942394cc6274018e4ebe53">CurrencyAmount</a>. </div> </div><p> <a class="anchor" name="12a125d7259801aa8f040eed0e424c0d"></a><!-- doxytag: member="Measure::operator==" ref="12a125d7259801aa8f040eed0e424c0d" args="(const UObject &other) const" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="umachine_8h.html#349ef00011f20ccd1d3b424445681aa5">UBool</a> Measure::operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="classUObject.html">UObject</a> & </td> <td class="paramname"> <em>other</em> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table> </div> <div class="memdoc"> <p> Equality operator. <p> Return true if this object is equal to the given object. <dl compact><dt><b><a class="el" href="stable.html#_stable002482">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div><p> <a class="anchor" name="ab92958c1b03f04c426fe1c021801287"></a><!-- doxytag: member="Measure::getNumber" ref="ab92958c1b03f04c426fe1c021801287" args="() const" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classFormattable.html">Formattable</a> & Measure::getNumber </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return a reference to the numeric value of this object. <p> The numeric value may be of any numeric type supported by <a class="el" href="classFormattable.html">Formattable</a>. <dl compact><dt><b><a class="el" href="stable.html#_stable002483">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p> Definition at line <a class="el" href="measure_8h-source.html#l00126">126</a> of file <a class="el" href="measure_8h-source.html">measure.h</a>. </div> </div><p> <a class="anchor" name="41d0d155a1db01bcc1547497aeebfeac"></a><!-- doxytag: member="Measure::getUnit" ref="41d0d155a1db01bcc1547497aeebfeac" args="() const" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classMeasureUnit.html">MeasureUnit</a> & Measure::getUnit </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return a reference to the unit of this object. <p> <dl compact><dt><b><a class="el" href="stable.html#_stable002484">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p> Definition at line <a class="el" href="measure_8h-source.html#l00130">130</a> of file <a class="el" href="measure_8h-source.html">measure.h</a>. <p> Referenced by <a class="el" href="curramt_8h-source.html#l00119">CurrencyAmount::getCurrency()</a>. </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="measure_8h-source.html">measure.h</a></ul> <hr size="1"><address style="align: right;"><small>Generated on Fri Sep 14 12:59:42 2007 for ICU 3.8 by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> </body> </html>