SimpleTimeZone.h

Go to the documentation of this file.
00001 #ifndef JAVA_UTIL_SIMPLETIMEZONE_H
00002 #define JAVA_UTIL_SIMPLETIMEZONE_H 1
00003 
00004 #ifndef JAVA_UTIL_TIMEZONE_H
00005 #include <java_util/TimeZone.h>
00006 #endif /* JAVA_UTIL_TIMEZONE_H */
00007 #ifndef JAVA_UTIL_DATE_H
00008 #include <java_util/Date.h>
00009 #endif /* JAVA_UTIL_DATE_H */
00010 
00011 namespace java {
00012   namespace util {
00013 
00020     class DSTRule : public Object {
00021 
00022     public:
00023 
00024       enum TIME {
00025 
00031         WALL_TIME = 0,
00032   
00036         STANDARD_TIME,
00037   
00042         UTC_TIME,
00043 
00044       };
00045 
00046       DSTRule();
00047 
00062       DSTRule(jint _month, jint _day, jint _dayOfWeek, jint _time, jint _timeMode = WALL_TIME);
00063 
00068       virtual jint hashCode() const;
00069 
00077       virtual jboolean equals(const Object& obj) const;
00078 
00086       virtual jboolean equals(const DSTRule& obj) const;
00087 
00097       jint compareTo(jint month, jint monthLen, jint prevMonthLen,
00098                      jint dayOfMonth, jint dayOfWeek, jint millis, jint millisDelta) const;
00099 
00103       virtual jboolean isEmpty() const;
00104 
00105       virtual void decode();
00106 
00116       jint month;
00117 
00142       jint day;
00143 
00153       jint dayOfWeek;
00154 
00163       jint time;
00164 
00171       jint timeMode;
00172 
00200       jint mode;
00201 
00202       REGISTER_MEMBERS;
00203 
00204     };
00205 
00222     class SimpleTimeZone : public TimeZone {
00223 
00224     public:
00225 
00236       SimpleTimeZone(jint rawOffset, const String& ID);
00237   
00287       SimpleTimeZone(jint rawOffset, const String& ID,
00288                      DSTRule startRule, DSTRule endRule,
00289                      jint dstSavings = millisPerHour);
00290 
00296       virtual void setStartYear(jint year);
00297 
00298       virtual void setStartRule(const DSTRule& _startRule);
00299 
00300       virtual void setEndRule(const DSTRule& _endRule);
00301 
00321       virtual jint getOffset(jint era, jint year, jint month, jint day, jint dayOfWeek,
00322                              jint millis, jint monthLength, jint prevMonthLength) const;
00323 
00324 
00329       virtual jint getRawOffset() const;
00330 
00337       virtual void setRawOffset(jint offsetMillis);
00338 
00346       virtual void setDSTSavings(jint millisSavedDuringDST);
00347 
00355       virtual jint getDSTSavings() const;
00356 
00361       virtual jboolean useDaylightTime() const;
00362 
00367       virtual jint hashCode() const;
00368 
00376       virtual jboolean equals(const Object& obj) const;
00377 
00384       virtual jboolean hasSameRules(const TimeZone& other) const;
00385 
00386       SimpleTimeZone();
00387 
00388     protected:
00389   
00390     private:
00391 
00399       jint startYear;
00400 
00408       jint rawOffset;
00409 
00415       jboolean useDaylight; // indicate if this time zone uses DST
00416 
00425       jint dstSavings;
00426 
00430       DSTRule startRule;
00431     
00435       DSTRule endRule;
00436  
00437       REGISTER_MEMBERS;
00438 
00439     };
00440 
00441   } // namespace util
00442 } // namespace java
00443 
00444 #endif /* JAVA_UTIL_SIMPLETIMEZONE_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3