]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/main/classes/core/src/com/ibm/icu/util/CurrencyAmount.java
go
[Dictionary.git] / jars / icu4j-4_4_2-src / main / classes / core / src / com / ibm / icu / util / CurrencyAmount.java
1 /*\r
2 **********************************************************************\r
3 * Copyright (c) 2004-2010, 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 \r
14 /**\r
15  * An amount of currency, consisting of a Number and a Currency.\r
16  * CurrencyAmount objects are immutable.\r
17  *\r
18  * @see java.lang.Number\r
19  * @see Currency\r
20  * @author Alan Liu\r
21  * @stable ICU 3.0\r
22  */\r
23 public class CurrencyAmount extends Measure {\r
24     \r
25     /**\r
26      * Constructs a new object given a number and a currency.\r
27      * @param number the number\r
28      * @param currency the currency\r
29      * @stable ICU 3.0\r
30      */\r
31     public CurrencyAmount(Number number, Currency currency) {\r
32         super(number, currency);\r
33     }\r
34 \r
35     /**\r
36      * Constructs a new object given a double value and a currency.\r
37      * @param number a double value\r
38      * @param currency the currency\r
39      * @stable ICU 3.0\r
40      */\r
41     public CurrencyAmount(double number, Currency currency) {\r
42         super(new Double(number), currency);\r
43     }    \r
44     \r
45     /**\r
46      * Returns the currency of this object.\r
47      * @return this object's Currency\r
48      * @stable ICU 3.0\r
49      */\r
50     public Currency getCurrency() {\r
51         return (Currency) getUnit();\r
52     }\r
53 }\r