ICU 76.1 76.1
|
TimeZoneTransition
is a class representing a time zone transition.
More...
#include <tztrans.h>
Public Member Functions | |
TimeZoneTransition (UDate time, const TimeZoneRule &from, const TimeZoneRule &to) | |
Constructs a TimeZoneTransition with the time and the rules before/after the transition. | |
TimeZoneTransition () | |
Constructs an empty TimeZoneTransition | |
TimeZoneTransition (const TimeZoneTransition &source) | |
Copy constructor. | |
~TimeZoneTransition () | |
Destructor. | |
TimeZoneTransition * | clone () const |
Clone this TimeZoneTransition object polymorphically. | |
TimeZoneTransition & | operator= (const TimeZoneTransition &right) |
Assignment operator. | |
bool | operator== (const TimeZoneTransition &that) const |
Return true if the given TimeZoneTransition objects are semantically equal. | |
bool | operator!= (const TimeZoneTransition &that) const |
Return true if the given TimeZoneTransition objects are semantically unequal. | |
UDate | getTime () const |
Returns the time of transition in milliseconds. | |
void | setTime (UDate time) |
Sets the time of transition in milliseconds. | |
const TimeZoneRule * | getFrom () const |
Returns the rule used before the transition. | |
void | setFrom (const TimeZoneRule &from) |
Sets the rule used before the transition. | |
void | adoptFrom (TimeZoneRule *from) |
Adopts the rule used before the transition. | |
void | setTo (const TimeZoneRule &to) |
Sets the rule used after the transition. | |
void | adoptTo (TimeZoneRule *to) |
Adopts the rule used after the transition. | |
const TimeZoneRule * | getTo () const |
Returns the rule used after the transition. | |
virtual UClassID | getDynamicClassID () const override |
Returns a unique class ID POLYMORPHICALLY. | |
Public Member Functions inherited from icu::UObject | |
virtual | ~UObject () |
Destructor. | |
Static Public Member Functions | |
static UClassID | getStaticClassID () |
Return the class ID for this class. | |
TimeZoneTransition
is a class representing a time zone transition.
An instance has a time of transition and rules for both before and after the transition.
icu::TimeZoneTransition::TimeZoneTransition | ( | UDate | time, |
const TimeZoneRule & | from, | ||
const TimeZoneRule & | to | ||
) |
Constructs a TimeZoneTransition
with the time and the rules before/after the transition.
time | The time of transition in milliseconds since the base time. |
from | The time zone rule used before the transition. |
to | The time zone rule used after the transition. |
icu::TimeZoneTransition::TimeZoneTransition | ( | ) |
Constructs an empty TimeZoneTransition
icu::TimeZoneTransition::TimeZoneTransition | ( | const TimeZoneTransition & | source | ) |
icu::TimeZoneTransition::~TimeZoneTransition | ( | ) |
Destructor.
void icu::TimeZoneTransition::adoptFrom | ( | TimeZoneRule * | from | ) |
Adopts the rule used before the transition.
The caller must not delete the TimeZoneRule
object passed in.
from | The time zone rule used before the transition. |
void icu::TimeZoneTransition::adoptTo | ( | TimeZoneRule * | to | ) |
Adopts the rule used after the transition.
The caller must not delete the TimeZoneRule
object passed in.
to | The time zone rule used after the transition. |
TimeZoneTransition * icu::TimeZoneTransition::clone | ( | ) | const |
Clone this TimeZoneTransition object polymorphically.
The caller owns the result and should delete it when done.
Returns a unique class ID POLYMORPHICALLY.
Pure virtual override. This method is to implement a simple version of RTTI, since not all C++ compilers support genuine RTTI. Polymorphic operator==() and clone() methods call this method.
Reimplemented from icu::UObject.
const TimeZoneRule * icu::TimeZoneTransition::getFrom | ( | ) | const |
Returns the rule used before the transition.
Return the class ID for this class.
This is useful only for comparing to a return value from getDynamicClassID(). For example:
. Base* polymorphic_pointer = createPolymorphicObject(); . if (polymorphic_pointer->getDynamicClassID() == . erived::getStaticClassID()) ...
UDate icu::TimeZoneTransition::getTime | ( | ) | const |
Returns the time of transition in milliseconds.
const TimeZoneRule * icu::TimeZoneTransition::getTo | ( | ) | const |
Returns the rule used after the transition.
bool icu::TimeZoneTransition::operator!= | ( | const TimeZoneTransition & | that | ) | const |
Return true if the given TimeZoneTransition objects are semantically unequal.
Objects of different subclasses are considered unequal.
that | The object to be compared with. |
TimeZoneTransition & icu::TimeZoneTransition::operator= | ( | const TimeZoneTransition & | right | ) |
bool icu::TimeZoneTransition::operator== | ( | const TimeZoneTransition & | that | ) | const |
Return true if the given TimeZoneTransition objects are semantically equal.
Objects of different subclasses are considered unequal.
that | The object to be compared with. |
void icu::TimeZoneTransition::setFrom | ( | const TimeZoneRule & | from | ) |
Sets the rule used before the transition.
The caller remains responsible for deleting the TimeZoneRule
object.
from | The time zone rule used before the transition. |
Sets the time of transition in milliseconds.
time | The time of the transition in milliseconds since the 1970 Jan 1 epoch time. |
void icu::TimeZoneTransition::setTo | ( | const TimeZoneRule & | to | ) |
Sets the rule used after the transition.
The caller remains responsible for deleting the TimeZoneRule
object.
to | The time zone rule used after the transition. |