ICU 4.8.1.1  4.8.1.1
Public Member Functions | Static Public Member Functions
TimeArrayTimeZoneRule Class Reference

TimeArrayTimeZoneRule represents a time zone rule whose start times are defined by an array of milliseconds since the standard base time. More...

#include <tzrule.h>

Inheritance diagram for TimeArrayTimeZoneRule:
TimeZoneRule UObject UMemory

Public Member Functions

 TimeArrayTimeZoneRule (const UnicodeString &name, int32_t rawOffset, int32_t dstSavings, const UDate *startTimes, int32_t numStartTimes, DateTimeRule::TimeRuleType timeRuleType)
 Constructs a TimeArrayTimeZoneRule with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment and the array of times when this rule takes effect.
 TimeArrayTimeZoneRule (const TimeArrayTimeZoneRule &source)
 Copy constructor.
virtual ~TimeArrayTimeZoneRule ()
 Destructor.
virtual TimeArrayTimeZoneRuleclone (void) const
 Clone this TimeArrayTimeZoneRule object polymorphically.
TimeArrayTimeZoneRuleoperator= (const TimeArrayTimeZoneRule &right)
 Assignment operator.
virtual UBool operator== (const TimeZoneRule &that) const
 Return true if the given TimeZoneRule objects are semantically equal.
virtual UBool operator!= (const TimeZoneRule &that) const
 Return true if the given TimeZoneRule objects are semantically unequal.
DateTimeRule::TimeRuleType getTimeType (void) const
 Gets the time type of the start times used by this rule.
UBool getStartTimeAt (int32_t index, UDate &result) const
 Gets a start time at the index stored in this rule.
int32_t countStartTimes (void) const
 Returns the number of start times stored in this rule.
virtual UBool isEquivalentTo (const TimeZoneRule &that) const
 Returns if this rule represents the same rule and offsets as another.
virtual UBool getFirstStart (int32_t prevRawOffset, int32_t prevDSTSavings, UDate &result) const
 Gets the very first time when this rule takes effect.
virtual UBool getFinalStart (int32_t prevRawOffset, int32_t prevDSTSavings, UDate &result) const
 Gets the final time when this rule takes effect.
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.
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.
virtual UClassID getDynamicClassID (void) const
 Returns a unique class ID POLYMORPHICALLY.

Static Public Member Functions

static UClassID getStaticClassID (void)
 Return the class ID for this class.

Detailed Description

TimeArrayTimeZoneRule represents a time zone rule whose start times are defined by an array of milliseconds since the standard base time.

Stable:
ICU 3.8

Definition at line 616 of file tzrule.h.


Constructor & Destructor Documentation

TimeArrayTimeZoneRule::TimeArrayTimeZoneRule ( const UnicodeString name,
int32_t  rawOffset,
int32_t  dstSavings,
const UDate startTimes,
int32_t  numStartTimes,
DateTimeRule::TimeRuleType  timeRuleType 
)

Constructs a TimeArrayTimeZoneRule with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment and the array of times when this rule takes effect.

Parameters:
nameThe time zone name.
rawOffsetThe UTC offset of its standard time in milliseconds.
dstSavingsThe amount of daylight saving offset adjustment in milliseconds. If this ia a rule for standard time, the value of this argument is 0.
startTimesThe array start times in milliseconds since the base time (January 1, 1970, 00:00:00).
numStartTimesThe number of elements in the parameter "startTimes"
timeRuleTypeThe time type of the start times, which is one of DataTimeRule::WALL_TIME, STANDARD_TIME and UTC_TIME.
Stable:
ICU 3.8

Copy constructor.

Parameters:
sourceThe TimeArrayTimeZoneRule object to be copied.
Stable:
ICU 3.8

Destructor.

Stable:
ICU 3.8

Member Function Documentation

virtual TimeArrayTimeZoneRule* TimeArrayTimeZoneRule::clone ( void  ) const [virtual]

Clone this TimeArrayTimeZoneRule object polymorphically.

The caller owns the result and should delete it when done.

Returns:
A copy of the object.
Stable:
ICU 3.8

Implements TimeZoneRule.

Returns the number of start times stored in this rule.

Returns:
The number of start times.
Stable:
ICU 3.8
virtual UClassID TimeArrayTimeZoneRule::getDynamicClassID ( void  ) const [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.

Returns:
The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs.
Stable:
ICU 3.8

Implements UObject.

virtual UBool TimeArrayTimeZoneRule::getFinalStart ( int32_t  prevRawOffset,
int32_t  prevDSTSavings,
UDate result 
) const [virtual]

Gets the final time when this rule takes effect.

Parameters:
prevRawOffsetThe standard time offset from UTC before this rule takes effect in milliseconds.
prevDSTSavingsThe amount of daylight saving offset from the standard time.
resultReceives the final time when this rule takes effect.
Returns:
true if the start time is available. When false is returned, output parameter "result" is unchanged.
Stable:
ICU 3.8

Implements TimeZoneRule.

virtual UBool TimeArrayTimeZoneRule::getFirstStart ( int32_t  prevRawOffset,
int32_t  prevDSTSavings,
UDate result 
) const [virtual]

Gets the very first time when this rule takes effect.

Parameters:
prevRawOffsetThe standard time offset from UTC before this rule takes effect in milliseconds.
prevDSTSavingsThe amount of daylight saving offset from the standard time.
resultReceives the very first time when this rule takes effect.
Returns:
true if the start time is available. When false is returned, output parameter "result" is unchanged.
Stable:
ICU 3.8

Implements TimeZoneRule.

virtual UBool TimeArrayTimeZoneRule::getNextStart ( UDate  base,
int32_t  prevRawOffset,
int32_t  prevDSTSavings,
UBool  inclusive,
UDate result 
) const [virtual]

Gets the first time when this rule takes effect after the specified time.

Parameters:
baseThe first start time after this base time will be returned.
prevRawOffsetThe standard time offset from UTC before this rule takes effect in milliseconds.
prevDSTSavingsThe amount of daylight saving offset from the standard time.
inclusiveWhether the base time is inclusive or not.
resultReceives The first time when this rule takes effect after the specified base time.
Returns:
true if the start time is available. When false is returned, output parameter "result" is unchanged.
Stable:
ICU 3.8

Implements TimeZoneRule.

virtual UBool TimeArrayTimeZoneRule::getPreviousStart ( UDate  base,
int32_t  prevRawOffset,
int32_t  prevDSTSavings,
UBool  inclusive,
UDate result 
) const [virtual]

Gets the most recent time when this rule takes effect before the specified time.

Parameters:
baseThe most recent time before this base time will be returned.
prevRawOffsetThe standard time offset from UTC before this rule takes effect in milliseconds.
prevDSTSavingsThe amount of daylight saving offset from the standard time.
inclusiveWhether the base time is inclusive or not.
resultReceives The most recent time when this rule takes effect before the specified base time.
Returns:
true if the start time is available. When false is returned, output parameter "result" is unchanged.
Stable:
ICU 3.8

Implements TimeZoneRule.

UBool TimeArrayTimeZoneRule::getStartTimeAt ( int32_t  index,
UDate result 
) const

Gets a start time at the index stored in this rule.

Parameters:
indexThe index of start times
resultReceives the start time at the index
Returns:
true if the index is within the valid range and and the result is set. When false, the output parameger "result" is unchanged.
Stable:
ICU 3.8

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()) ...
 
Returns:
The class ID for all objects of this class.
Stable:
ICU 3.8

Gets the time type of the start times used by this rule.

The return value is either DateTimeRule::WALL_TIME or STANDARD_TIME or UTC_TIME.

Returns:
The time type used of the start times used by this rule.
Stable:
ICU 3.8
virtual UBool TimeArrayTimeZoneRule::isEquivalentTo ( const TimeZoneRule that) const [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.

Parameters:
thatThe TimeZoneRule object to be compared with.
Returns:
true if the other TimeZoneRule is equivalent to this one.
Stable:
ICU 3.8

Reimplemented from TimeZoneRule.

virtual UBool TimeArrayTimeZoneRule::operator!= ( const TimeZoneRule that) const [virtual]

Return true if the given TimeZoneRule objects are semantically unequal.

Objects of different subclasses are considered unequal.

Parameters:
thatThe object to be compared with.
Returns:
true if the given TimeZoneRule objects are semantically unequal.
Stable:
ICU 3.8

Reimplemented from TimeZoneRule.

TimeArrayTimeZoneRule& TimeArrayTimeZoneRule::operator= ( const TimeArrayTimeZoneRule right)

Assignment operator.

Parameters:
rightThe object to be copied.
Stable:
ICU 3.8
virtual UBool TimeArrayTimeZoneRule::operator== ( const TimeZoneRule that) const [virtual]

Return true if the given TimeZoneRule objects are semantically equal.

Objects of different subclasses are considered unequal.

Parameters:
thatThe object to be compared with.
Returns:
true if the given TimeZoneRule objects are semantically equal.
Stable:
ICU 3.8

Reimplemented from TimeZoneRule.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines