]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_2_1-src/src/com/ibm/icu/util/CurrencyAmount.java
icu4jsrc
[Dictionary.git] / jars / icu4j-4_2_1-src / src / com / ibm / icu / util / CurrencyAmount.java
1 /*\r
2 **********************************************************************\r
3 * Copyright (c) 2004-2006, International Business Machines\r
4 * Corporation and others.  All Rights Reserved.\r
5 **********************************************************************\r
6 * Author: Alan Liu\r
7 * Created: April 12, 2004\r
8 * Since: ICU 3.0\r
9 **********************************************************************\r
10 */\r
11 package com.ibm.icu.util;\r
12 \r
13 import java.lang.Number;\r
14 \r
15 /**\r
16  * An amount of currency, consisting of a Number and a Currency.\r
17  * CurrencyAmount objects are immutable.\r
18  *\r
19  * @see java.lang.Number\r
20  * @see Currency\r
21  * @author Alan Liu\r
22  * @stable ICU 3.0\r
23  */\r
24 public class CurrencyAmount extends Measure {\r
25     \r
26     /**\r
27      * Constructs a new object given a number and a currency.\r
28      * @param number the number\r
29      * @param currency the currency\r
30      * @stable ICU 3.0\r
31      */\r
32     public CurrencyAmount(Number number, Currency currency) {\r
33         super(number, currency);\r
34     }\r
35 \r
36     /**\r
37      * Constructs a new object given a double value and a currency.\r
38      * @param number a double value\r
39      * @param currency the currency\r
40      * @stable ICU 3.0\r
41      */\r
42     public CurrencyAmount(double number, Currency currency) {\r
43         super(new Double(number), currency);\r
44     }    \r
45     \r
46     /**\r
47      * Returns the currency of this object.\r
48      * @return this object's Currency\r
49      * @stable ICU 3.0\r
50      */\r
51     public Currency getCurrency() {\r
52         return (Currency) getUnit();\r
53     }\r
54 }\r