]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/tztrans.cpp
2 *******************************************************************************
3 * Copyright (C) 2007, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
8 #include "unicode/utypes.h"
10 #if !UCONFIG_NO_FORMATTING
12 #include "unicode/tzrule.h"
13 #include "unicode/tztrans.h"
17 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeZoneTransition
)
19 TimeZoneTransition::TimeZoneTransition(UDate time
, const TimeZoneRule
& from
, const TimeZoneRule
& to
)
20 : UObject(), fTime(time
), fFrom(from
.clone()), fTo(to
.clone()) {
23 TimeZoneTransition::TimeZoneTransition()
24 : UObject(), fTime(0), fFrom(NULL
), fTo(NULL
) {
27 TimeZoneTransition::TimeZoneTransition(const TimeZoneTransition
& source
)
28 : UObject(), fTime(source
.fTime
), fFrom(NULL
), fTo(NULL
) {
29 if (source
.fFrom
!= NULL
) {
30 fFrom
= source
.fFrom
->clone();
33 if (source
.fTo
!= NULL
) {
34 fTo
= source
.fTo
->clone();
38 TimeZoneTransition::~TimeZoneTransition() {
48 TimeZoneTransition::clone(void) const {
49 return new TimeZoneTransition(*this);
53 TimeZoneTransition::operator=(const TimeZoneTransition
& right
) {
56 setFrom(*right
.fFrom
);
63 TimeZoneTransition::operator==(const TimeZoneTransition
& that
) const {
67 if (getDynamicClassID() != that
.getDynamicClassID()) {
70 if (fTime
!= that
.fTime
) {
73 if (fFrom
== NULL
&& that
.fFrom
== NULL
74 || fFrom
!= NULL
&& that
.fFrom
!= NULL
&& *fFrom
== *(that
.fFrom
)) {
75 if (fTo
== NULL
&& that
.fTo
== NULL
76 || fTo
!= NULL
&& that
.fTo
!= NULL
&& *fTo
== *(that
.fTo
)) {
84 TimeZoneTransition::operator!=(const TimeZoneTransition
& that
) const {
85 return !operator==(that
);
89 TimeZoneTransition::setTime(UDate time
) {
94 TimeZoneTransition::setFrom(const TimeZoneRule
& from
) {
102 TimeZoneTransition::adoptFrom(TimeZoneRule
* from
) {
110 TimeZoneTransition::setTo(const TimeZoneRule
& to
) {
118 TimeZoneTransition::adoptTo(TimeZoneRule
* to
) {
126 TimeZoneTransition::getTime(void) const {
131 TimeZoneTransition::getTo(void) const {
136 TimeZoneTransition::getFrom(void) const {