Home | History | Annotate | Download | only in util
      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      * Returns the currency of this object.
     47      * @return this object's Currency
     48      */
     49     public Currency getCurrency() {
     50         return (Currency) getUnit();
     51     }
     52 }
     53