Logo Search packages:      
Sourcecode: icu version File versions

SimpleTimeZone Class Reference

#include <simpletz.h>

Inheritance diagram for SimpleTimeZone:

BasicTimeZone TimeZone UObject UMemory

List of all members.


Detailed Description

SimpleTimeZone is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar. This class does not handle historical changes.

When specifying daylight-savings-time begin and end dates, use a negative value for dayOfWeekInMonth to indicate that SimpleTimeZone should count from the end of the month backwards. For example, if Daylight Savings Time starts or ends at the last Sunday a month, use dayOfWeekInMonth = -1 along with dayOfWeek = UCAL_SUNDAY to specify the rule.

See also:
Calendar

GregorianCalendar

TimeZone

Author:
D. Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu

Definition at line 61 of file simpletz.h.


Public Types

enum  { kStandard = 0x01, kDaylight = 0x03, kFormer = 0x04, kLatter = 0x0C }
enum  EDisplayType { SHORT = 1, LONG }
enum  TimeMode { WALL_TIME = 0, STANDARD_TIME, UTC_TIME }

Public Member Functions

virtual TimeZoneclone (void) const
virtual int32_t countTransitionRules (UErrorCode &status)
UnicodeStringgetDisplayName (UBool daylight, EDisplayType style, const Locale &locale, UnicodeString &result) const
UnicodeStringgetDisplayName (UBool daylight, EDisplayType style, UnicodeString &result) const
UnicodeStringgetDisplayName (const Locale &locale, UnicodeString &result) const
UnicodeStringgetDisplayName (UnicodeString &result) const
virtual int32_t getDSTSavings (void) const
virtual UClassID getDynamicClassID (void) const
UnicodeStringgetID (UnicodeString &ID) const
virtual UBool getNextTransition (UDate base, UBool inclusive, TimeZoneTransition &result)
virtual void getOffset (UDate date, UBool local, int32_t &rawOffset, int32_t &dstOffset, UErrorCode &ec) const
virtual int32_t getOffset (uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t milliseconds, int32_t monthLength, int32_t prevMonthLength, UErrorCode &status) const
virtual int32_t getOffset (uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t milliseconds, int32_t monthLength, UErrorCode &status) const
virtual int32_t getOffset (uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis, UErrorCode &status) const
virtual void getOffsetFromLocal (UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt, int32_t &rawOffset, int32_t &dstOffset, UErrorCode &status)
virtual UBool getPreviousTransition (UDate base, UBool inclusive, TimeZoneTransition &result)
virtual int32_t getRawOffset (void) const
virtual void getSimpleRulesNear (UDate date, InitialTimeZoneRule *&initial, AnnualTimeZoneRule *&std, AnnualTimeZoneRule *&dst, UErrorCode &status)
virtual void getTimeZoneRules (const InitialTimeZoneRule *&initial, const TimeZoneRule *trsrules[], int32_t &trscount, UErrorCode &status)
virtual UBool hasEquivalentTransitions (BasicTimeZone &tz, UDate start, UDate end, UBool ignoreDstAmount, UErrorCode &ec)
UBool hasSameRules (const TimeZone &other) const
virtual UBool inDaylightTime (UDate date, UErrorCode &status) const
UBool operator!= (const TimeZone &that) const
SimpleTimeZoneoperator= (const SimpleTimeZone &right)
virtual UBool operator== (const TimeZone &that) const
void setDSTSavings (int32_t millisSavedDuringDST, UErrorCode &status)
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UBool after, UErrorCode &status)
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, UBool after, UErrorCode &status)
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t time, TimeMode mode, UErrorCode &status)
void setEndRule (int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode &status)
void setEndRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UErrorCode &status)
void setEndRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, UErrorCode &status)
void setID (const UnicodeString &ID)
virtual void setRawOffset (int32_t offsetMillis)
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UBool after, UErrorCode &status)
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, int32_t time, UBool after, UErrorCode &status)
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t time, TimeMode mode, UErrorCode &status)
void setStartRule (int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode &status)
void setStartRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, TimeMode mode, UErrorCode &status)
void setStartRule (int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek, int32_t time, UErrorCode &status)
void setStartYear (int32_t year)
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID, int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, int8_t savingsStartDayOfWeek, int32_t savingsStartTime, TimeMode savingsStartTimeMode, int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, int8_t savingsEndDayOfWeek, int32_t savingsEndTime, TimeMode savingsEndTimeMode, int32_t savingsDST, UErrorCode &status)
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID, int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, int8_t savingsStartDayOfWeek, int32_t savingsStartTime, int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, int8_t savingsEndDayOfWeek, int32_t savingsEndTime, int32_t savingsDST, UErrorCode &status)
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID, int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, int8_t savingsStartDayOfWeek, int32_t savingsStartTime, int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, int8_t savingsEndDayOfWeek, int32_t savingsEndTime, UErrorCode &status)
 SimpleTimeZone (int32_t rawOffsetGMT, const UnicodeString &ID)
 SimpleTimeZone (const SimpleTimeZone &source)
virtual UBool useDaylightTime (void) const
virtual ~SimpleTimeZone ()

Static Public Member Functions

static void U_EXPORT2 adoptDefault (TimeZone *zone)
static int32_t U_EXPORT2 countEquivalentIDs (const UnicodeString &id)
static TimeZone *U_EXPORT2 createDefault (void)
static StringEnumeration *U_EXPORT2 createEnumeration (const char *country)
static StringEnumeration *U_EXPORT2 createEnumeration (int32_t rawOffset)
static StringEnumeration *U_EXPORT2 createEnumeration ()
static TimeZone *U_EXPORT2 createTimeZone (const UnicodeString &ID)
static UnicodeString &U_EXPORT2 getCanonicalID (const UnicodeString &id, UnicodeString &canonicalID, UBool &isSystemID, UErrorCode &status)
static UnicodeString &U_EXPORT2 getCanonicalID (const UnicodeString &id, UnicodeString &canonicalID, UErrorCode &status)
static const UnicodeString
U_EXPORT2 
getEquivalentID (const UnicodeString &id, int32_t index)
static const TimeZone *U_EXPORT2 getGMT (void)
static UClassID U_EXPORT2 getStaticClassID (void)
static const char *U_EXPORT2 getTZDataVersion (UErrorCode &status)
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW
static void U_EXPORT2 setDefault (const TimeZone &zone)

Protected Types

enum  { kStdDstMask = kDaylight, kFormerLatterMask = kLatter }

Protected Member Functions

void getTimeZoneRulesAfter (UDate start, InitialTimeZoneRule *&initial, UVector *&transitionRules, UErrorCode &status)

Static Protected Member Functions

static UResourceBundleloadRule (const UResourceBundle *top, const UnicodeString &ruleid, UResourceBundle *oldbundle, UErrorCode &status)

Private Types

enum  EMode { DOM_MODE = 1, DOW_IN_MONTH_MODE, DOW_GE_DOM_MODE, DOW_LE_DOM_MODE }

Private Member Functions

void clearTransitionRules (void)
void construct (int32_t rawOffsetGMT, int8_t startMonth, int8_t startDay, int8_t startDayOfWeek, int32_t startTime, TimeMode startTimeMode, int8_t endMonth, int8_t endDay, int8_t endDayOfWeek, int32_t endTime, TimeMode endTimeMode, int32_t dstSavings, UErrorCode &status)
void decodeEndRule (UErrorCode &status)
void decodeRules (UErrorCode &status)
void decodeStartRule (UErrorCode &status)
void deleteTransitionRules (void)
void initTransitionRules (UErrorCode &status)

Static Private Member Functions

static int32_t compareToRule (int8_t month, int8_t monthLen, int8_t prevMonthLen, int8_t dayOfMonth, int8_t dayOfWeek, int32_t millis, int32_t millisDelta, EMode ruleMode, int8_t ruleMonth, int8_t ruleDayOfWeek, int8_t ruleDay, int32_t ruleMillis)

Private Attributes

AnnualTimeZoneRuledstRule
int32_t dstSavings
int8_t endDay
int8_t endDayOfWeek
EMode endMode
int8_t endMonth
int32_t endTime
TimeMode endTimeMode
TimeZoneTransitionfirstTransition
InitialTimeZoneRuleinitialRule
int32_t rawOffset
int8_t startDay
int8_t startDayOfWeek
EMode startMode
int8_t startMonth
int32_t startTime
TimeMode startTimeMode
int32_t startYear
AnnualTimeZoneRulestdRule
UBool transitionRulesInitialized
UBool useDaylight

Static Private Attributes

static const int8_t STATICMONTHLENGTH [12] = {31,29,31,30,31,30,31,31,30,31,30,31}

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index