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) 2008-2009, Google, International Business Machines 7 * Corporation and others. All Rights Reserved. 8 ************************************************************************** 9 */ 10 package android.icu.util; 11 12 /** 13 * Express a duration as a time unit and number. Patterned after Currency. 14 * <p>Immutable. 15 * @see TimeUnitAmount 16 * @see android.icu.text.TimeUnitFormat 17 * @author markdavis 18 * @hide Only a subset of ICU is exposed in Android 19 */ 20 public class TimeUnitAmount extends Measure { 21 22 /** 23 * Create from a number and unit. 24 */ 25 public TimeUnitAmount(Number number, TimeUnit unit) { 26 super(number, unit); 27 } 28 29 /** 30 * Create from a number and unit. 31 */ 32 public TimeUnitAmount(double number, TimeUnit unit) { 33 super(new Double(number), unit); 34 } 35 36 /** 37 * Get the unit (convenience to avoid cast). 38 */ 39 public TimeUnit getTimeUnit() { 40 return (TimeUnit) getUnit(); 41 } 42 } 43