CurrencyAmount.java revision d4d3fc6e0d919d96cdb282a05a05327cdf2c7f4e
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 */
23public 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     */
30    public CurrencyAmount(Number number, Currency currency) {
31        super(number, currency);
32    }
33
34    /**
35     * Constructs a new object given a double value and a currency.
36     * @param number a double value
37     * @param currency the currency
38     */
39    public CurrencyAmount(double number, Currency currency) {
40        super(new Double(number), currency);
41    }
42
43    /**
44     * Returns the currency of this object.
45     * @return this object's Currency
46     */
47    public Currency getCurrency() {
48        return (Currency) getUnit();
49    }
50}
51