ICU 66.0.1
66.0.1
|
AnnualTimeZoneRule
is a class used for representing a time zone rule which takes effect annually.
More...
#include <tzrule.h>
Public Member Functions | |
AnnualTimeZoneRule (const UnicodeString &name, int32_t rawOffset, int32_t dstSavings, const DateTimeRule &dateTimeRule, int32_t startYear, int32_t endYear) | |
Constructs a AnnualTimeZoneRule with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment, the annual start time rule and the start/until years. More... | |
AnnualTimeZoneRule (const UnicodeString &name, int32_t rawOffset, int32_t dstSavings, DateTimeRule *dateTimeRule, int32_t startYear, int32_t endYear) | |
Constructs a AnnualTimeZoneRule with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment, the annual start time rule and the start/until years. More... | |
AnnualTimeZoneRule (const AnnualTimeZoneRule &source) | |
Copy constructor. More... | |
virtual | ~AnnualTimeZoneRule () |
Destructor. More... | |
virtual AnnualTimeZoneRule * | clone () const |
Clone this AnnualTimeZoneRule object polymorphically. More... | |
AnnualTimeZoneRule & | operator= (const AnnualTimeZoneRule &right) |
Assignment operator. More... | |
virtual UBool | operator== (const TimeZoneRule &that) const |
Return true if the given TimeZoneRule objects are semantically equal. More... | |
virtual UBool | operator!= (const TimeZoneRule &that) const |
Return true if the given TimeZoneRule objects are semantically unequal. More... | |
const DateTimeRule * | getRule (void) const |
Gets the start date/time rule used by this rule. More... | |
int32_t | getStartYear (void) const |
Gets the first year when this rule takes effect. More... | |
int32_t | getEndYear (void) const |
Gets the end year when this rule takes effect. More... | |
UBool | getStartInYear (int32_t year, int32_t prevRawOffset, int32_t prevDSTSavings, UDate &result) const |
Gets the time when this rule takes effect in the given year. More... | |
virtual UBool | isEquivalentTo (const TimeZoneRule &that) const |
Returns if this rule represents the same rule and offsets as another. More... | |
virtual UBool | getFirstStart (int32_t prevRawOffset, int32_t prevDSTSavings, UDate &result) const |
Gets the very first time when this rule takes effect. More... | |
virtual UBool | getFinalStart (int32_t prevRawOffset, int32_t prevDSTSavings, UDate &result) const |
Gets the final time when this rule takes effect. More... | |
virtual UBool | getNextStart (UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, UBool inclusive, UDate &result) const |
Gets the first time when this rule takes effect after the specified time. More... | |
virtual UBool | getPreviousStart (UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, UBool inclusive, UDate &result) const |
Gets the most recent time when this rule takes effect before the specified time. More... | |
virtual UClassID | getDynamicClassID (void) const |
Returns a unique class ID POLYMORPHICALLY. More... | |
Public Member Functions inherited from icu::TimeZoneRule | |
virtual | ~TimeZoneRule () |
Destructor. More... | |
UnicodeString & | getName (UnicodeString &name) const |
Fills in "name" with the name of this time zone. More... | |
int32_t | getRawOffset (void) const |
Gets the standard time offset. More... | |
int32_t | getDSTSavings (void) const |
Gets the amount of daylight saving delta time from the standard time. More... | |
Public Member Functions inherited from icu::UObject | |
virtual | ~UObject () |
Destructor. More... | |
Static Public Member Functions | |
static UClassID | getStaticClassID (void) |
Return the class ID for this class. More... | |
Static Public Attributes | |
static const int32_t | MAX_YEAR |
The constant representing the maximum year used for designating a rule is permanent. | |
Additional Inherited Members | |
Protected Member Functions inherited from icu::TimeZoneRule | |
TimeZoneRule (const UnicodeString &name, int32_t rawOffset, int32_t dstSavings) | |
Constructs a TimeZoneRule with the name, the GMT offset of its standard time and the amount of daylight saving offset adjustment. More... | |
TimeZoneRule (const TimeZoneRule &source) | |
Copy constructor. More... | |
TimeZoneRule & | operator= (const TimeZoneRule &right) |
Assignment operator. More... | |
AnnualTimeZoneRule
is a class used for representing a time zone rule which takes effect annually.
The calenday system used for the rule is is based on Gregorian calendar
icu::AnnualTimeZoneRule::AnnualTimeZoneRule | ( | const UnicodeString & | name, |
int32_t | rawOffset, | ||
int32_t | dstSavings, | ||
const DateTimeRule & | dateTimeRule, | ||
int32_t | startYear, | ||
int32_t | endYear | ||
) |
Constructs a AnnualTimeZoneRule
with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment, the annual start time rule and the start/until years.
The input DateTimeRule is copied by this constructor, so the caller remains responsible for deleting the object.
name | The time zone name. |
rawOffset | The GMT offset of its standard time in milliseconds. |
dstSavings | The amount of daylight saving offset adjustment in milliseconds. If this ia a rule for standard time, the value of this argument is 0. |
dateTimeRule | The start date/time rule repeated annually. |
startYear | The first year when this rule takes effect. |
endYear | The last year when this rule takes effect. If this rule is effective forever in future, specify MAX_YEAR. |
icu::AnnualTimeZoneRule::AnnualTimeZoneRule | ( | const UnicodeString & | name, |
int32_t | rawOffset, | ||
int32_t | dstSavings, | ||
DateTimeRule * | dateTimeRule, | ||
int32_t | startYear, | ||
int32_t | endYear | ||
) |
Constructs a AnnualTimeZoneRule
with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment, the annual start time rule and the start/until years.
The input DateTimeRule object is adopted by this object, therefore, the caller must not delete the object.
name | The time zone name. |
rawOffset | The GMT offset of its standard time in milliseconds. |
dstSavings | The amount of daylight saving offset adjustment in milliseconds. If this ia a rule for standard time, the value of this argument is 0. |
dateTimeRule | The start date/time rule repeated annually. |
startYear | The first year when this rule takes effect. |
endYear | The last year when this rule takes effect. If this rule is effective forever in future, specify MAX_YEAR. |
icu::AnnualTimeZoneRule::AnnualTimeZoneRule | ( | const AnnualTimeZoneRule & | source | ) |
|
virtual |
Destructor.
|
virtual |
Clone this AnnualTimeZoneRule object polymorphically.
The caller owns the result and should delete it when done.
Implements icu::TimeZoneRule.
|
virtual |
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.
int32_t icu::AnnualTimeZoneRule::getEndYear | ( | void | ) | const |
Gets the end year when this rule takes effect.
|
virtual |
Gets the final time when this rule takes effect.
prevRawOffset | The standard time offset from UTC before this rule takes effect in milliseconds. |
prevDSTSavings | The amount of daylight saving offset from the standard time. |
result | Receives the final time when this rule takes effect. |
Implements icu::TimeZoneRule.
|
virtual |
Gets the very first time when this rule takes effect.
prevRawOffset | The standard time offset from UTC before this rule takes effect in milliseconds. |
prevDSTSavings | The amount of daylight saving offset from the standard time. |
result | Receives the very first time when this rule takes effect. |
Implements icu::TimeZoneRule.
|
virtual |
Gets the first time when this rule takes effect after the specified time.
base | The first start time after this base time will be returned. |
prevRawOffset | The standard time offset from UTC before this rule takes effect in milliseconds. |
prevDSTSavings | The amount of daylight saving offset from the standard time. |
inclusive | Whether the base time is inclusive or not. |
result | Receives The first time when this rule takes effect after the specified base time. |
Implements icu::TimeZoneRule.
|
virtual |
Gets the most recent time when this rule takes effect before the specified time.
base | The most recent time before this base time will be returned. |
prevRawOffset | The standard time offset from UTC before this rule takes effect in milliseconds. |
prevDSTSavings | The amount of daylight saving offset from the standard time. |
inclusive | Whether the base time is inclusive or not. |
result | Receives The most recent time when this rule takes effect before the specified base time. |
Implements icu::TimeZoneRule.
const DateTimeRule* icu::AnnualTimeZoneRule::getRule | ( | void | ) | const |
Gets the start date/time rule used by this rule.
AnnualDateTimeRule
which represents the start date/time rule used by this time zone rule. UBool icu::AnnualTimeZoneRule::getStartInYear | ( | int32_t | year, |
int32_t | prevRawOffset, | ||
int32_t | prevDSTSavings, | ||
UDate & | result | ||
) | const |
Gets the time when this rule takes effect in the given year.
year | The Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc. |
prevRawOffset | The standard time offset from UTC before this rule takes effect in milliseconds. |
prevDSTSavings | The amount of daylight saving offset from the standard time. |
result | Receives the start time in the year. |
int32_t icu::AnnualTimeZoneRule::getStartYear | ( | void | ) | const |
Gets the first year when this rule takes effect.
|
static |
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()) ...
|
virtual |
Returns if this rule represents the same rule and offsets as another.
When two TimeZoneRule
objects differ only its names, this method returns true.
that | The TimeZoneRule object to be compared with. |
TimeZoneRule
is equivalent to this one. Reimplemented from icu::TimeZoneRule.
|
virtual |
Return true if the given TimeZoneRule
objects are semantically unequal.
Objects of different subclasses are considered unequal.
that | The object to be compared with. |
TimeZoneRule
objects are semantically unequal. Reimplemented from icu::TimeZoneRule.
AnnualTimeZoneRule& icu::AnnualTimeZoneRule::operator= | ( | const AnnualTimeZoneRule & | right | ) |
|
virtual |
Return true if the given TimeZoneRule
objects are semantically equal.
Objects of different subclasses are considered unequal.
that | The object to be compared with. |
TimeZoneRule
objects are semantically equal. Reimplemented from icu::TimeZoneRule.