1 /* GENERATED SOURCE. DO NOT MODIFY. */ 2 // 2016 and later: Unicode, Inc. and others. 3 // License & terms of use: http://www.unicode.org/copyright.html#License 4 /* 5 ********************************************************************** 6 * Copyright (c) 2004-2010, International Business Machines 7 * Corporation and others. All Rights Reserved. 8 ********************************************************************** 9 * Author: Alan Liu 10 * Created: April 12, 2004 11 * Since: ICU 3.0 12 ********************************************************************** 13 */ 14 package android.icu.util; 15 16 17 /** 18 * An amount of currency, consisting of a Number and a Currency. 19 * CurrencyAmount objects are immutable. 20 * 21 * @see java.lang.Number 22 * @see Currency 23 * @author Alan Liu 24 */ 25 public 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 */ 32 public CurrencyAmount(Number number, Currency currency) { 33 super(number, currency); 34 } 35 36 /** 37 * Constructs a new object given a double value and a currency. 38 * @param number a double value 39 * @param currency the currency 40 */ 41 public CurrencyAmount(double number, Currency currency) { 42 super(new Double(number), currency); 43 } 44 45 /** 46 * Constructs a new object given a number and a Java currency. 47 * @param number the number 48 * @param currency the currency 49 * @hide draft / provisional / internal are hidden on Android 50 */ 51 public CurrencyAmount(Number number, java.util.Currency currency) { 52 this(number, Currency.fromJavaCurrency(currency)); 53 } 54 55 /** 56 * Constructs a new object given a double value and a Java currency. 57 * @param number a double value 58 * @param currency the currency 59 * @hide draft / provisional / internal are hidden on Android 60 */ 61 public CurrencyAmount(double number, java.util.Currency currency) { 62 this(number, Currency.fromJavaCurrency(currency)); 63 } 64 65 /** 66 * Returns the currency of this object. 67 * @return this object's Currency 68 */ 69 public Currency getCurrency() { 70 return (Currency) getUnit(); 71 } 72 } 73