]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/main/classes/core/src/com/ibm/icu/util/TimeUnitAmount.java
go
[Dictionary.git] / jars / icu4j-4_4_2-src / main / classes / core / src / com / ibm / icu / util / TimeUnitAmount.java
1 /*\r
2  **************************************************************************\r
3  * Copyright (C) 2008-2009, Google, International Business Machines\r
4  * Corporation and others. All Rights Reserved.\r
5  **************************************************************************\r
6  */\r
7 package com.ibm.icu.util;\r
8 \r
9 /**\r
10  * Express a duration as a time unit and number. Patterned after Currency.\r
11  * <p>Immutable.\r
12  * @see TimeUnitAmount\r
13  * @see com.ibm.icu.text.TimeUnitFormat\r
14  * @author markdavis\r
15  * @stable ICU 4.0\r
16  */\r
17 public class TimeUnitAmount extends Measure {\r
18 \r
19     /**\r
20      * Create from a number and unit.\r
21      * @stable ICU 4.0\r
22      */\r
23     public TimeUnitAmount(Number number, TimeUnit unit) {\r
24         super(number, unit);\r
25     }\r
26 \r
27     /**\r
28      * Create from a number and unit.\r
29      * @stable ICU 4.0\r
30      */\r
31     public TimeUnitAmount(double number, TimeUnit unit) {\r
32         super(new Double(number), unit);\r
33     }\r
34 \r
35     /**\r
36      * Get the unit (convenience to avoid cast).\r
37      * @stable ICU 4.0\r
38      */\r
39     public TimeUnit getTimeUnit() {\r
40         return (TimeUnit) getUnit();\r
41     }\r
42 }\r