view modules/javafx.web/src/main/native/Source/ThirdParty/icu/source/i18n/tmutamt.cpp @ 11038:20a8447c71c6

8207159: Update ICU to version 62.1 Reviewed-by: mbilla, kcr, ghb
author arajkumar
date Fri, 24 Aug 2018 15:06:40 +0530
parents fee4ef5c87df
children
line wrap: on
line source
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
 *******************************************************************************
 * Copyright (C) 2008, Google, International Business Machines Corporation and *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 */

#include "unicode/tmutamt.h"

#if !UCONFIG_NO_FORMATTING

U_NAMESPACE_BEGIN

UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeUnitAmount)


TimeUnitAmount::TimeUnitAmount(const Formattable& number,
                               TimeUnit::UTimeUnitFields timeUnitField,
                               UErrorCode& status)
:    Measure(number, TimeUnit::createInstance(timeUnitField, status), status) {
}


TimeUnitAmount::TimeUnitAmount(double amount,
                               TimeUnit::UTimeUnitFields timeUnitField,
                               UErrorCode& status)
:   Measure(Formattable(amount),
            TimeUnit::createInstance(timeUnitField, status),
            status) {
}


TimeUnitAmount::TimeUnitAmount(const TimeUnitAmount& other)
:   Measure(other)
{
}


TimeUnitAmount&
TimeUnitAmount::operator=(const TimeUnitAmount& other) {
    Measure::operator=(other);
    return *this;
}


UBool
TimeUnitAmount::operator==(const UObject& other) const {
    return Measure::operator==(other);
}

UObject*
TimeUnitAmount::clone() const {
    return new TimeUnitAmount(*this);
}


TimeUnitAmount::~TimeUnitAmount() {
}



const TimeUnit&
TimeUnitAmount::getTimeUnit() const {
    return (const TimeUnit&) getUnit();
}


TimeUnit::UTimeUnitFields
TimeUnitAmount::getTimeUnitField() const {
    return getTimeUnit().getTimeUnitField();
}


U_NAMESPACE_END

#endif