CurrencyAmount.java revision 704056c96cc5de08c2425fa1679a5c0a92c5a88e
1/* GENERATED SOURCE. DO NOT MODIFY. */
2/*
3**********************************************************************
4* Copyright (c) 2004-2010, International Business Machines
5* Corporation and others.  All Rights Reserved.
6**********************************************************************
7* Author: Alan Liu
8* Created: April 12, 2004
9* Since: ICU 3.0
10**********************************************************************
11*/
12package android.icu.util;
13
14
15/**
16 * An amount of currency, consisting of a Number and a Currency.
17 * CurrencyAmount objects are immutable.
18 *
19 * @see java.lang.Number
20 * @see Currency
21 * @author Alan Liu
22 * @stable ICU 3.0
23 * @hide All android.icu classes are currently hidden
24 */
25public class CurrencyAmount extends Measure {
26
27    /**
28     * Constructs a new object given a number and a currency.
29     * @param number the number
30     * @param currency the currency
31     * @stable ICU 3.0
32     */
33    public CurrencyAmount(Number number, Currency currency) {
34        super(number, currency);
35    }
36
37    /**
38     * Constructs a new object given a double value and a currency.
39     * @param number a double value
40     * @param currency the currency
41     * @stable ICU 3.0
42     */
43    public CurrencyAmount(double number, Currency currency) {
44        super(new Double(number), currency);
45    }
46
47    /**
48     * Returns the currency of this object.
49     * @return this object's Currency
50     * @stable ICU 3.0
51     */
52    public Currency getCurrency() {
53        return (Currency) getUnit();
54    }
55}
56