GregorianCalendar.h

Go to the documentation of this file.
00001 #ifndef JAVA_UTIL_GREGORIANCALENDAR_H
00002 #define JAVA_UTIL_GREGORIANCALENDAR_H 1
00003 
00004 #ifndef JAVA_UTIL_CALENDAR_H
00005 #include <java_util/Calendar.h>
00006 #endif /* JAVA_UTIL_CALENDAR_H */
00007 
00008 namespace java {
00009   namespace util {
00010 
00166     class JAVA_UTIL_SPEC GregorianCalendar : public Calendar {
00167 
00168     public:
00169 
00170       enum {
00174         BC = 0, 
00175         AD
00176       };
00177 
00182       GregorianCalendar();
00183 
00189       GregorianCalendar(const TimeZone& zone);
00190 
00199       GregorianCalendar(jint year, jint month, jint date);
00200 
00213       GregorianCalendar(jint year, jint month, jint date, jint hour, jint minute);
00214 
00229       GregorianCalendar(jint year, jint month, jint date, jint hour, jint minute, jint second);
00230 
00242       void setGregorianChange(const Date& date);
00243 
00251       const Date getGregorianChange() const;
00252 
00259       virtual jboolean isLeapYear(jint year) const;
00260 
00266       virtual jboolean equals(const Object& obj) const;
00267 
00272       virtual jint hashCode() const;
00273 
00283       virtual void add(jint field, jint amount);
00284 
00293       virtual void roll(jint field, jboolean up);
00294 
00299       virtual void roll(jint field, jint amount);
00300 
00307       virtual jint getMinimum(jint field) const;
00308 
00315       virtual jint getMaximum(jint field) const;
00316 
00323       virtual jint getGreatestMinimum(jint field) const;
00324 
00331       virtual jint getLeastMaximum(jint field) const;
00332 
00338       virtual jint getActualMinimum(jint field) const;
00339 
00347       virtual jint getActualMaximum(jint field) const;    
00348 
00354  virtual jboolean inDaylightTime() const;
00355 
00370       virtual jint getISOYear() const;
00371 
00372     protected:
00373 
00382       virtual void computeFields();
00383 
00389       virtual void computeTime();
00390 
00391     private:
00392 
00401       jlong gregorianCutover;
00402 
00408       jlong normalizedGregorianCutover;
00409 
00414       jint gregorianCutoverYear;
00415 
00430       void timeToFields(jlong theTime, jboolean quick);
00431 
00440       jlong computeJulianDay(jboolean isGregorian, jint year);
00441 
00448       static jint aggregateStamp(jint stamp_a, jint stamp_b);
00449 
00464       jint weekNumber(jint dayOfPeriod, jint dayOfWeek) const;
00465 
00466       jint monthLength(jint month, jint year) const;
00467 
00468       jint monthLength(jint month) const;
00469 
00476       jint prevMonthLength(jint month) const;
00477 
00478       jint yearLength(jint year) const;
00479 
00480       jint yearLength() const;
00481 
00488       void pinDayOfMonth();
00489 
00493       virtual jboolean validateFields();
00494 
00498       jboolean boundsCheck(jint value, jint field) const;
00499 
00504       jlong getEpochDay() const;
00505 
00510       jint internalGetEra() const;
00511 
00512       REGISTER_MEMBERS;
00513 
00514     };
00515 
00516   } // namespace util
00517 } // namespace java
00518 
00519 #endif /* JAVA_UTIL_GREGRORIANCALENDAR_H */

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