<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>ICU 4.4.1: CurrencyAmount Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="classes.html"><span>Data Structure Index</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> </div> <div class="contents"> <h1>CurrencyAmount Class Reference</h1><!-- doxytag: class="CurrencyAmount" --><!-- doxytag: inherits="Measure" --> <p>A currency together with a numeric amount, such as 200 USD. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="curramt_8h_source.html">curramt.h</a>></code></p> <div class="dynheader"> Inheritance diagram for CurrencyAmount:</div> <div class="dynsection"> <div class="center"> <img src="classCurrencyAmount.png" usemap="#CurrencyAmount_map" alt=""/> <map id="CurrencyAmount_map" name="CurrencyAmount_map"> <area href="classMeasure.html" alt="Measure" shape="rect" coords="0,112,108,136"/> <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"/> </map> </div> </div> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#aa01ed3e0ec82d5074c40812c9664b765">CurrencyAmount</a> (const <a class="el" href="classFormattable.html">Formattable</a> &amount, const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *isoCode, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &ec)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an object with the given numeric amount and the given ISO currency code. <a href="#aa01ed3e0ec82d5074c40812c9664b765"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a96bd4e3e106d7892b49d45af01fb4a1e">CurrencyAmount</a> (double amount, const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> *isoCode, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &ec)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an object with the given numeric amount and the given ISO currency code. <a href="#a96bd4e3e106d7892b49d45af01fb4a1e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#aac10e9dcf1578af646760d01d9c1eed1">CurrencyAmount</a> (const <a class="el" href="classCurrencyAmount.html">CurrencyAmount</a> &other)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <a href="#aac10e9dcf1578af646760d01d9c1eed1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCurrencyAmount.html">CurrencyAmount</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a715828f7d013aa777e091730ac2d33b7">operator=</a> (const <a class="el" href="classCurrencyAmount.html">CurrencyAmount</a> &other)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Assignment operator. <a href="#a715828f7d013aa777e091730ac2d33b7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classUObject.html">UObject</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a324129012688a7d6213669f062b74b76">clone</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return a polymorphic clone of this object. <a href="#a324129012688a7d6213669f062b74b76"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#abfee982a80a6241961b02b883c1852f9">~CurrencyAmount</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#abfee982a80a6241961b02b883c1852f9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a656cac9ccc74debabb28ae79942b082f">getDynamicClassID</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a unique class ID for this object POLYMORPHICALLY. <a href="#a656cac9ccc74debabb28ae79942b082f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classCurrencyUnit.html">CurrencyUnit</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a9601d6dd26b64a40978c64b074b64073">getCurrency</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the currency unit object of this object. <a href="#a9601d6dd26b64a40978c64b074b64073"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a99954a6dac387603d04cedaa1333a78b">getISOCurrency</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the ISO currency code of this object. <a href="#a99954a6dac387603d04cedaa1333a78b"></a><br/></td></tr> <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classCurrencyAmount.html#a068714f400a5c13931cd9ba31c82ff21">getStaticClassID</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the class ID for this class. <a href="#a068714f400a5c13931cd9ba31c82ff21"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>A currency together with a numeric amount, such as 200 USD. </p> <dl class="author"><dt><b>Author:</b></dt><dd>Alan Liu </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002337">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p>Definition at line <a class="el" href="curramt_8h_source.html#l00035">35</a> of file <a class="el" href="curramt_8h_source.html">curramt.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="aa01ed3e0ec82d5074c40812c9664b765"></a><!-- doxytag: member="CurrencyAmount::CurrencyAmount" ref="aa01ed3e0ec82d5074c40812c9664b765" args="(const Formattable &amount, const UChar *isoCode, UErrorCode &ec)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">CurrencyAmount::CurrencyAmount </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFormattable.html">Formattable</a> & </td> <td class="paramname"> <em>amount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td> <td class="paramname"> <em>isoCode</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td> <td class="paramname"> <em>ec</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Construct an object with the given numeric amount and the given ISO currency code. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>amount</em> </td><td>a numeric object; amount.isNumeric() must be TRUE </td></tr> <tr><td valign="top"></td><td valign="top"><em>isoCode</em> </td><td>the 3-letter ISO 4217 currency code; must not be NULL and must have length 3 </td></tr> <tr><td valign="top"></td><td valign="top"><em>ec</em> </td><td>input-output error code. If the amount or the isoCode is invalid, then this will be set to a failing value. </td></tr> </table> </dd> </dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002338">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div> <a class="anchor" id="a96bd4e3e106d7892b49d45af01fb4a1e"></a><!-- doxytag: member="CurrencyAmount::CurrencyAmount" ref="a96bd4e3e106d7892b49d45af01fb4a1e" args="(double amount, const UChar *isoCode, UErrorCode &ec)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">CurrencyAmount::CurrencyAmount </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>amount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * </td> <td class="paramname"> <em>isoCode</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td> <td class="paramname"> <em>ec</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Construct an object with the given numeric amount and the given ISO currency code. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>amount</em> </td><td>the amount of the given currency </td></tr> <tr><td valign="top"></td><td valign="top"><em>isoCode</em> </td><td>the 3-letter ISO 4217 currency code; must not be NULL and must have length 3 </td></tr> <tr><td valign="top"></td><td valign="top"><em>ec</em> </td><td>input-output error code. If the isoCode is invalid, then this will be set to a failing value. </td></tr> </table> </dd> </dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002339">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div> <a class="anchor" id="aac10e9dcf1578af646760d01d9c1eed1"></a><!-- doxytag: member="CurrencyAmount::CurrencyAmount" ref="aac10e9dcf1578af646760d01d9c1eed1" args="(const CurrencyAmount &other)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">CurrencyAmount::CurrencyAmount </td> <td>(</td> <td class="paramtype">const <a class="el" href="classCurrencyAmount.html">CurrencyAmount</a> & </td> <td class="paramname"> <em>other</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Copy constructor. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002340">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div> <a class="anchor" id="abfee982a80a6241961b02b883c1852f9"></a><!-- doxytag: member="CurrencyAmount::~CurrencyAmount" ref="abfee982a80a6241961b02b883c1852f9" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual CurrencyAmount::~CurrencyAmount </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002343">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a324129012688a7d6213669f062b74b76"></a><!-- doxytag: member="CurrencyAmount::clone" ref="a324129012688a7d6213669f062b74b76" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classUObject.html">UObject</a>* CurrencyAmount::clone </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return a polymorphic clone of this object. </p> <p>The result will have the same class as returned by <a class="el" href="classCurrencyAmount.html#a656cac9ccc74debabb28ae79942b082f" title="Returns a unique class ID for this object POLYMORPHICALLY.">getDynamicClassID()</a>. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002342">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p>Implements <a class="el" href="classMeasure.html#abc87db8d55945660b2ea2cd3d0713b89">Measure</a>.</p> </div> </div> <a class="anchor" id="a9601d6dd26b64a40978c64b074b64073"></a><!-- doxytag: member="CurrencyAmount::getCurrency" ref="a9601d6dd26b64a40978c64b074b64073" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classCurrencyUnit.html">CurrencyUnit</a> & CurrencyAmount::getCurrency </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the currency unit object of this object. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002346">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p>Definition at line <a class="el" href="curramt_8h_source.html#l00119">119</a> of file <a class="el" href="curramt_8h_source.html">curramt.h</a>.</p> <p>References <a class="el" href="measure_8h_source.html#l00130">Measure::getUnit()</a>.</p> <p>Referenced by <a class="el" href="curramt_8h_source.html#l00123">getISOCurrency()</a>.</p> </div> </div> <a class="anchor" id="a656cac9ccc74debabb28ae79942b082f"></a><!-- doxytag: member="CurrencyAmount::getDynamicClassID" ref="a656cac9ccc74debabb28ae79942b082f" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> CurrencyAmount::getDynamicClassID </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns a unique class ID for this object POLYMORPHICALLY. </p> <p>This method implements a simple form of RTTI used by ICU. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002344">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p>Implements <a class="el" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262">UObject</a>.</p> </div> </div> <a class="anchor" id="a99954a6dac387603d04cedaa1333a78b"></a><!-- doxytag: member="CurrencyAmount::getISOCurrency" ref="a99954a6dac387603d04cedaa1333a78b" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac">UChar</a> * CurrencyAmount::getISOCurrency </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the ISO currency code of this object. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002347">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> <p>Definition at line <a class="el" href="curramt_8h_source.html#l00123">123</a> of file <a class="el" href="curramt_8h_source.html">curramt.h</a>.</p> <p>References <a class="el" href="curramt_8h_source.html#l00119">getCurrency()</a>, and <a class="el" href="currunit_8h_source.html#l00110">CurrencyUnit::getISOCurrency()</a>.</p> </div> </div> <a class="anchor" id="a068714f400a5c13931cd9ba31c82ff21"></a><!-- doxytag: member="CurrencyAmount::getStaticClassID" ref="a068714f400a5c13931cd9ba31c82ff21" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a> CurrencyAmount::getStaticClassID </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the class ID for this class. </p> <p>This is used to compare to the return value of <a class="el" href="classCurrencyAmount.html#a656cac9ccc74debabb28ae79942b082f" title="Returns a unique class ID for this object POLYMORPHICALLY.">getDynamicClassID()</a>. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>The class ID for all objects of this class. </dd></dl> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002345">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div> <a class="anchor" id="a715828f7d013aa777e091730ac2d33b7"></a><!-- doxytag: member="CurrencyAmount::operator=" ref="a715828f7d013aa777e091730ac2d33b7" args="(const CurrencyAmount &other)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCurrencyAmount.html">CurrencyAmount</a>& CurrencyAmount::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classCurrencyAmount.html">CurrencyAmount</a> & </td> <td class="paramname"> <em>other</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Assignment operator. </p> <dl class="stable"><dt><b><a class="el" href="stable.html#_stable002341">Stable:</a></b></dt><dd>ICU 3.0 </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="curramt_8h_source.html">curramt.h</a></li> </ul> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>