BasicTimeZone Class Reference

BasicTimeZone is an abstract class extending TimeZone. More...

#include <basictz.h>

Inheritance diagram for BasicTimeZone:
TimeZone UObject UMemory RuleBasedTimeZone SimpleTimeZone VTimeZone

Public Types

enum  { kStandard = 0x01, kDaylight = 0x03, kFormer = 0x04, kLatter = 0x0C }
 

The time type option bit flags used by getOffsetFromLocal.

More...

Public Member Functions

virtual ~BasicTimeZone ()
 Destructor.
virtual UBool getNextTransition (UDate base, UBool inclusive, TimeZoneTransition &result)=0
 Gets the first time zone transition after the base time.
virtual UBool getPreviousTransition (UDate base, UBool inclusive, TimeZoneTransition &result)=0
 Gets the most recent time zone transition before the base time.
virtual UBool hasEquivalentTransitions (BasicTimeZone &tz, UDate start, UDate end, UBool ignoreDstAmount, UErrorCode &ec)
 Checks if the time zone has equivalent transitions in the time range.
virtual int32_t countTransitionRules (UErrorCode &status)=0
 Returns the number of TimeZoneRules which represents time transitions, for this time zone, that is, all TimeZoneRules for this time zone except InitialTimeZoneRule.
virtual void getTimeZoneRules (const InitialTimeZoneRule *&initial, const TimeZoneRule *trsrules[], int32_t &trscount, UErrorCode &status)=0
 Gets the InitialTimeZoneRule and the set of TimeZoneRule which represent time transitions for this time zone.
virtual void getSimpleRulesNear (UDate date, InitialTimeZoneRule *&initial, AnnualTimeZoneRule *&std, AnnualTimeZoneRule *&dst, UErrorCode &status)
 Gets the set of time zone rules valid at the specified time.
virtual void getOffsetFromLocal (UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt, int32_t &rawOffset, int32_t &dstOffset, UErrorCode &status)
 Get time zone offsets from local wall time.

Protected Types

enum  { kStdDstMask = kDaylight, kFormerLatterMask = kLatter }
 

The time type option bit masks used by getOffsetFromLocal.

More...

Protected Member Functions

 BasicTimeZone ()
 Default constructor.
 BasicTimeZone (const UnicodeString &id)
 Construct a timezone with a given ID.
 BasicTimeZone (const BasicTimeZone &source)
 Copy constructor.
void getTimeZoneRulesAfter (UDate start, InitialTimeZoneRule *&initial, UVector *&transitionRules, UErrorCode &status)
 Gets the set of TimeZoneRule instances applicable to the specified time and after.

Detailed Description

BasicTimeZone is an abstract class extending TimeZone.

This class provides some additional methods to access time zone transitions and rules. All ICU TimeZone concrete subclasses extend this class.

Stable:
ICU 3.8

Definition at line 34 of file basictz.h.


Member Enumeration Documentation

anonymous enum

The time type option bit flags used by getOffsetFromLocal.

Internal:
Do not use. This API is for internal use only.

Definition at line 148 of file basictz.h.

anonymous enum [protected]

The time type option bit masks used by getOffsetFromLocal.

Internal:
Do not use. This API is for internal use only.

Definition at line 168 of file basictz.h.


Constructor & Destructor Documentation

virtual BasicTimeZone::~BasicTimeZone (  )  [virtual]

Destructor.

Stable:
ICU 3.8
BasicTimeZone::BasicTimeZone (  )  [protected]

Default constructor.

Stable:
ICU 3.8
BasicTimeZone::BasicTimeZone ( const UnicodeString id  )  [protected]

Construct a timezone with a given ID.

Parameters:
id a system time zone ID
Stable:
ICU 3.8
BasicTimeZone::BasicTimeZone ( const BasicTimeZone source  )  [protected]

Copy constructor.

Parameters:
source the object to be copied.
Stable:
ICU 3.8

Member Function Documentation

virtual int32_t BasicTimeZone::countTransitionRules ( UErrorCode status  )  [pure virtual]

Returns the number of TimeZoneRules which represents time transitions, for this time zone, that is, all TimeZoneRules for this time zone except InitialTimeZoneRule.

The return value range is 0 or any positive value.

Parameters:
status Receives error status code.
Returns:
The number of TimeZoneRules representing time transitions.
Stable:
ICU 3.8

Implemented in RuleBasedTimeZone, SimpleTimeZone, and VTimeZone.

virtual UBool BasicTimeZone::getNextTransition ( UDate  base,
UBool  inclusive,
TimeZoneTransition result 
) [pure virtual]

Gets the first time zone transition after the base time.

Parameters:
base The base time.
inclusive Whether the base time is inclusive or not.
result Receives the first transition after the base time.
Returns:
TRUE if the transition is found.
Stable:
ICU 3.8

Implemented in RuleBasedTimeZone, SimpleTimeZone, and VTimeZone.

virtual void BasicTimeZone::getOffsetFromLocal ( UDate  date,
int32_t  nonExistingTimeOpt,
int32_t  duplicatedTimeOpt,
int32_t &  rawOffset,
int32_t &  dstOffset,
UErrorCode status 
) [virtual]

Get time zone offsets from local wall time.

Internal:
Do not use. This API is for internal use only.

Reimplemented in RuleBasedTimeZone, and SimpleTimeZone.

virtual UBool BasicTimeZone::getPreviousTransition ( UDate  base,
UBool  inclusive,
TimeZoneTransition result 
) [pure virtual]

Gets the most recent time zone transition before the base time.

Parameters:
base The base time.
inclusive Whether the base time is inclusive or not.
result Receives the most recent transition before the base time.
Returns:
TRUE if the transition is found.
Stable:
ICU 3.8

Implemented in RuleBasedTimeZone, SimpleTimeZone, and VTimeZone.

virtual void BasicTimeZone::getSimpleRulesNear ( UDate  date,
InitialTimeZoneRule *&  initial,
AnnualTimeZoneRule *&  std,
AnnualTimeZoneRule *&  dst,
UErrorCode status 
) [virtual]

Gets the set of time zone rules valid at the specified time.

Some known external time zone implementations are not capable to handle historic time zone rule changes. Also some implementations can only handle certain type of rule definitions. If this time zone does not use any daylight saving time within about 1 year from the specified time, only the InitialTimeZone is returned. Otherwise, the rule for standard time and daylight saving time transitions are returned in addition to the InitialTimeZoneRule. The standard and daylight saving time transition rules are represented by AnnualTimeZoneRule with DateTimeRule::DOW for its date rule and DateTimeRule::WALL_TIME for its time rule. Because daylight saving time rule is changing time to time in many time zones and also mapping a transition time rule to different type is lossy transformation, the set of rules returned by this method may be valid for short period of time. The time zone rule objects returned by this method is owned by the caller, so the caller is responsible for deleting them after use.

Parameters:
date The date used for extracting time zone rules.
initial Receives the InitialTimeZone, always not NULL.
std Receives the AnnualTimeZoneRule for standard time transitions. When this time time zone does not observe daylight saving times around the specified date, NULL is set.
dst Receives the AnnualTimeZoneRule for daylight saving time transitions. When this time zone does not observer daylight saving times around the specified date, NULL is set.
status Receives error status code.
Stable:
ICU 3.8
virtual void BasicTimeZone::getTimeZoneRules ( const InitialTimeZoneRule *&  initial,
const TimeZoneRule trsrules[],
int32_t &  trscount,
UErrorCode status 
) [pure virtual]

Gets the InitialTimeZoneRule and the set of TimeZoneRule which represent time transitions for this time zone.

On successful return, the argument initial points to non-NULL InitialTimeZoneRule and the array trsrules is filled with 0 or multiple TimeZoneRule instances up to the size specified by trscount. The results are referencing the rule instance held by this time zone instance. Therefore, after this time zone is destructed, they are no longer available.

Parameters:
initial Receives the initial timezone rule
trsrules Receives the timezone transition rules
trscount On input, specify the size of the array 'transitions' receiving the timezone transition rules. On output, actual number of rules filled in the array will be set.
status Receives error status code.
Stable:
ICU 3.8

Implemented in RuleBasedTimeZone, SimpleTimeZone, and VTimeZone.

void BasicTimeZone::getTimeZoneRulesAfter ( UDate  start,
InitialTimeZoneRule *&  initial,
UVector *&  transitionRules,
UErrorCode status 
) [protected]

Gets the set of TimeZoneRule instances applicable to the specified time and after.

Parameters:
start The start date used for extracting time zone rules
initial Receives the InitialTimeZone, always not NULL
transitionRules Receives the transition rules, could be NULL
status Receives error status code
virtual UBool BasicTimeZone::hasEquivalentTransitions ( BasicTimeZone tz,
UDate  start,
UDate  end,
UBool  ignoreDstAmount,
UErrorCode ec 
) [virtual]

Checks if the time zone has equivalent transitions in the time range.

This method returns true when all of transition times, from/to standard offsets and DST savings used by this time zone match the other in the time range.

Parameters:
tz The BasicTimeZone object to be compared with.
start The start time of the evaluated time range (inclusive)
end The end time of the evaluated time range (inclusive)
ignoreDstAmount When true, any transitions with only daylight saving amount changes will be ignored, except either of them is zero. For example, a transition from rawoffset 3:00/dstsavings 1:00 to rawoffset 2:00/dstsavings 2:00 is excluded from the comparison, but a transtion from rawoffset 2:00/dstsavings 1:00 to rawoffset 3:00/dstsavings 0:00 is included.
ec Output param to filled in with a success or an error.
Returns:
true if the other time zone has the equivalent transitions in the time range.
Stable:
ICU 3.8

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

Generated on Sat Jan 23 15:17:41 2010 for ICU 4.3.4 by  doxygen 1.6.1