2 *******************************************************************************
3 * Copyright (C) 2008, Google, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
8 #include "unicode/tmutamt.h"
10 #if !UCONFIG_NO_FORMATTING
14 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeUnitAmount
)
17 TimeUnitAmount::TimeUnitAmount(const Formattable
& number
,
18 TimeUnit::UTimeUnitFields timeUnitField
,
20 : Measure(number
, TimeUnit::createInstance(timeUnitField
, status
), status
) {
24 TimeUnitAmount::TimeUnitAmount(double amount
,
25 TimeUnit::UTimeUnitFields timeUnitField
,
27 : Measure(Formattable(amount
),
28 TimeUnit::createInstance(timeUnitField
, status
),
33 TimeUnitAmount::TimeUnitAmount(const TimeUnitAmount
& other
)
40 TimeUnitAmount::operator=(const TimeUnitAmount
& other
) {
41 Measure::operator=(other
);
47 TimeUnitAmount::operator==(const UObject
& other
) const {
48 return Measure::operator==(other
);
52 TimeUnitAmount::clone() const {
53 return new TimeUnitAmount(*this);
57 TimeUnitAmount::~TimeUnitAmount() {
63 TimeUnitAmount::getTimeUnit() const {
64 return (const TimeUnit
&) getUnit();
68 TimeUnit::UTimeUnitFields
69 TimeUnitAmount::getTimeUnitField() const {
70 return getTimeUnit().getTimeUnitField();