OLD | NEW |
1 // © 2016 and later: Unicode, Inc. and others. | 1 // © 2016 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html#License | 2 // License & terms of use: http://www.unicode.org/copyright.html#License |
3 /* | 3 /* |
4 ********************************************************************** | 4 ********************************************************************** |
5 * Copyright (c) 2004-2013, International Business Machines | 5 * Copyright (c) 2004-2013, International Business Machines |
6 * Corporation and others. All Rights Reserved. | 6 * Corporation and others. All Rights Reserved. |
7 ********************************************************************** | 7 ********************************************************************** |
8 * Author: Alan Liu | 8 * Author: Alan Liu |
9 * Created: April 20, 2004 | 9 * Created: April 20, 2004 |
10 * Since: ICU 3.0 | 10 * Since: ICU 3.0 |
(...skipping 25 matching lines...) Expand all Loading... |
36 private final MeasureUnit unit; | 36 private final MeasureUnit unit; |
37 | 37 |
38 /** | 38 /** |
39 * Constructs a new object given a number and a unit. | 39 * Constructs a new object given a number and a unit. |
40 * @param number the number | 40 * @param number the number |
41 * @param unit the unit | 41 * @param unit the unit |
42 * @stable ICU 3.0 | 42 * @stable ICU 3.0 |
43 */ | 43 */ |
44 public Measure(Number number, MeasureUnit unit) { | 44 public Measure(Number number, MeasureUnit unit) { |
45 if (number == null || unit == null) { | 45 if (number == null || unit == null) { |
46 throw new NullPointerException(); | 46 throw new NullPointerException("Number and MeasureUnit must not be n
ull"); |
47 } | 47 } |
48 this.number = number; | 48 this.number = number; |
49 this.unit = unit; | 49 this.unit = unit; |
50 } | 50 } |
51 | 51 |
52 /** | 52 /** |
53 * Returns true if the given object is equal to this object. | 53 * Returns true if the given object is equal to this object. |
54 * @return true if this object is equal to the given object | 54 * @return true if this object is equal to the given object |
55 * @stable ICU 3.0 | 55 * @stable ICU 3.0 |
56 */ | 56 */ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 /** | 116 /** |
117 * Returns the unit of this object. | 117 * Returns the unit of this object. |
118 * @return this object's Unit | 118 * @return this object's Unit |
119 * @stable ICU 3.0 | 119 * @stable ICU 3.0 |
120 */ | 120 */ |
121 public MeasureUnit getUnit() { | 121 public MeasureUnit getUnit() { |
122 return unit; | 122 return unit; |
123 } | 123 } |
124 } | 124 } |
OLD | NEW |