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