/src/mozilla-central/intl/icu/source/i18n/tmutamt.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // © 2016 and later: Unicode, Inc. and others. |
2 | | // License & terms of use: http://www.unicode.org/copyright.html |
3 | | /* |
4 | | ******************************************************************************* |
5 | | * Copyright (C) 2008, Google, International Business Machines Corporation and * |
6 | | * others. All Rights Reserved. * |
7 | | ******************************************************************************* |
8 | | */ |
9 | | |
10 | | #include "unicode/tmutamt.h" |
11 | | |
12 | | #if !UCONFIG_NO_FORMATTING |
13 | | |
14 | | U_NAMESPACE_BEGIN |
15 | | |
16 | | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeUnitAmount) |
17 | | |
18 | | |
19 | | TimeUnitAmount::TimeUnitAmount(const Formattable& number, |
20 | | TimeUnit::UTimeUnitFields timeUnitField, |
21 | | UErrorCode& status) |
22 | 0 | : Measure(number, TimeUnit::createInstance(timeUnitField, status), status) { |
23 | 0 | } |
24 | | |
25 | | |
26 | | TimeUnitAmount::TimeUnitAmount(double amount, |
27 | | TimeUnit::UTimeUnitFields timeUnitField, |
28 | | UErrorCode& status) |
29 | | : Measure(Formattable(amount), |
30 | | TimeUnit::createInstance(timeUnitField, status), |
31 | 0 | status) { |
32 | 0 | } |
33 | | |
34 | | |
35 | | TimeUnitAmount::TimeUnitAmount(const TimeUnitAmount& other) |
36 | | : Measure(other) |
37 | 0 | { |
38 | 0 | } |
39 | | |
40 | | |
41 | | TimeUnitAmount& |
42 | 0 | TimeUnitAmount::operator=(const TimeUnitAmount& other) { |
43 | 0 | Measure::operator=(other); |
44 | 0 | return *this; |
45 | 0 | } |
46 | | |
47 | | |
48 | | UBool |
49 | 0 | TimeUnitAmount::operator==(const UObject& other) const { |
50 | 0 | return Measure::operator==(other); |
51 | 0 | } |
52 | | |
53 | | UObject* |
54 | 0 | TimeUnitAmount::clone() const { |
55 | 0 | return new TimeUnitAmount(*this); |
56 | 0 | } |
57 | | |
58 | | |
59 | 0 | TimeUnitAmount::~TimeUnitAmount() { |
60 | 0 | } |
61 | | |
62 | | |
63 | | |
64 | | const TimeUnit& |
65 | 0 | TimeUnitAmount::getTimeUnit() const { |
66 | 0 | return (const TimeUnit&) getUnit(); |
67 | 0 | } |
68 | | |
69 | | |
70 | | TimeUnit::UTimeUnitFields |
71 | 0 | TimeUnitAmount::getTimeUnitField() const { |
72 | 0 | return getTimeUnit().getTimeUnitField(); |
73 | 0 | } |
74 | | |
75 | | |
76 | | U_NAMESPACE_END |
77 | | |
78 | | #endif |