Logo Search packages:      
Sourcecode: icu version File versions

Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes | Friends

HebrewCalendar Class Reference

#include <hebrwcal.h>

Inheritance diagram for HebrewCalendar:
Inheritance graph
[legend]
Collaboration diagram for HebrewCalendar:
Collaboration graph
[legend]

List of all members.

Public Types

enum  EAmpm { AM, PM }
enum  EDateFields {
  ERA, YEAR, MONTH, WEEK_OF_YEAR,
  WEEK_OF_MONTH, DATE, DAY_OF_YEAR, DAY_OF_WEEK,
  DAY_OF_WEEK_IN_MONTH, AM_PM, HOUR, HOUR_OF_DAY,
  MINUTE, SECOND, MILLISECOND, ZONE_OFFSET,
  DST_OFFSET, YEAR_WOY, DOW_LOCAL, EXTENDED_YEAR,
  JULIAN_DAY, MILLISECONDS_IN_DAY, IS_LEAP_MONTH, FIELD_COUNT = UCAL_FIELD_COUNT
}
enum  EDaysOfWeek {
  SUNDAY = 1, MONDAY, TUESDAY, WEDNESDAY,
  THURSDAY, FRIDAY, SATURDAY
}
enum  EEras {
  TISHRI, HESHVAN, KISLEV, TEVET,
  SHEVAT, ADAR_1, ADAR, NISAN,
  IYAR, SIVAN, TAMUZ, AV,
  ELUL
}
enum  EMonths {
  JANUARY, FEBRUARY, MARCH, APRIL,
  MAY, JUNE, JULY, AUGUST,
  SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER,
  UNDECIMBER
}

Public Member Functions

virtual void add (UCalendarDateFields field, int32_t amount, UErrorCode &status)
virtual void add (EDateFields field, int32_t amount, UErrorCode &status)
void adoptTimeZone (TimeZone *value)
UBool after (const Calendar &when, UErrorCode &status) const
UBool before (const Calendar &when, UErrorCode &status) const
void clear (void)
void clear (EDateFields field)
void clear (UCalendarDateFields field)
virtual Calendarclone (void) const
UBool equals (const Calendar &when, UErrorCode &status) const
virtual int32_t fieldDifference (UDate when, EDateFields field, UErrorCode &status)
virtual int32_t fieldDifference (UDate when, UCalendarDateFields field, UErrorCode &status)
int32_t get (EDateFields field, UErrorCode &status) const
int32_t get (UCalendarDateFields field, UErrorCode &status) const
int32_t getActualMaximum (EDateFields field, UErrorCode &status) const
virtual int32_t getActualMaximum (UCalendarDateFields field, UErrorCode &status) const
int32_t getActualMinimum (EDateFields field, UErrorCode &status) const
virtual int32_t getActualMinimum (UCalendarDateFields field, UErrorCode &status) const
virtual UCalendarWeekdayType getDayOfWeekType (UCalendarDaysOfWeek dayOfWeek, UErrorCode &status) const
virtual UClassID getDynamicClassID (void) const
EDaysOfWeek getFirstDayOfWeek (void) const
UCalendarDaysOfWeek getFirstDayOfWeek (UErrorCode &status) const
virtual int32_t getGreatestMinimum (EDateFields field) const
virtual int32_t getGreatestMinimum (UCalendarDateFields field) const
virtual int32_t getLeastMaximum (EDateFields field) const
virtual int32_t getLeastMaximum (UCalendarDateFields field) const
Locale getLocale (ULocDataLocaleType type, UErrorCode &status) const
const char * getLocaleID (ULocDataLocaleType type, UErrorCode &status) const
virtual int32_t getMaximum (EDateFields field) const
virtual int32_t getMaximum (UCalendarDateFields field) const
uint8_t getMinimalDaysInFirstWeek (void) const
virtual int32_t getMinimum (EDateFields field) const
virtual int32_t getMinimum (UCalendarDateFields field) const
UDate getTime (UErrorCode &status) const
const TimeZonegetTimeZone (void) const
virtual const char * getType () const
virtual int32_t getWeekendTransition (UCalendarDaysOfWeek dayOfWeek, UErrorCode &status) const
 HebrewCalendar (const Locale &aLocale, UErrorCode &success)
 HebrewCalendar (const HebrewCalendar &source)
virtual UBool isEquivalentTo (const Calendar &other) const
UBool isLenient (void) const
UBool isSet (UCalendarDateFields field) const
UBool isSet (EDateFields field) const
virtual UBool isWeekend (void) const
virtual UBool isWeekend (UDate date, UErrorCode &status) const
UBool operator!= (const Calendar &that) const
HebrewCalendaroperator= (const HebrewCalendar &right)
virtual UBool operator== (const Calendar &that) const
TimeZoneorphanTimeZone (void)
void roll (EDateFields field, UBool up, UErrorCode &status)
virtual void roll (UCalendarDateFields field, int32_t amount, UErrorCode &status)
virtual void roll (EDateFields field, int32_t amount, UErrorCode &status)
void roll (UCalendarDateFields field, UBool up, UErrorCode &status)
void set (UCalendarDateFields field, int32_t value)
void set (int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute)
void set (int32_t year, int32_t month, int32_t date)
void set (EDateFields field, int32_t value)
void set (int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second)
void setFirstDayOfWeek (EDaysOfWeek value)
void setFirstDayOfWeek (UCalendarDaysOfWeek value)
void setLenient (UBool lenient)
void setMinimalDaysInFirstWeek (uint8_t value)
void setTime (UDate date, UErrorCode &status)
void setTimeZone (const TimeZone &zone)
virtual ~HebrewCalendar ()

Static Public Member Functions

static Calendar *U_EXPORT2 createInstance (UErrorCode &success)
static Calendar *U_EXPORT2 createInstance (TimeZone *zoneToAdopt, UErrorCode &success)
static Calendar *U_EXPORT2 createInstance (const TimeZone &zoneToAdopt, const Locale &aLocale, UErrorCode &success)
static Calendar *U_EXPORT2 createInstance (const TimeZone &zone, UErrorCode &success)
static Calendar *U_EXPORT2 createInstance (const Locale &aLocale, UErrorCode &success)
static Calendar *U_EXPORT2 createInstance (TimeZone *zoneToAdopt, const Locale &aLocale, UErrorCode &success)
static const Locale *U_EXPORT2 getAvailableLocales (int32_t &count)
static StringEnumerationgetAvailableLocales (void)
static StringEnumeration *U_EXPORT2 getKeywordValuesForLocale (const char *key, const Locale &locale, UBool commonlyUsed, UErrorCode &status)
static UDate U_EXPORT2 getNow (void)
static UClassID U_EXPORT2 getStaticClassID (void)
static UBool isLeapYear (int32_t year)
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
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 new (size_t size) 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 URegistryKey registerFactory (ICUServiceFactory *toAdopt, UErrorCode &status)
static UBool unregister (URegistryKey key, UErrorCode &status)

Protected Types

enum  { kResolveSTOP = -1, kResolveRemap = 32 }
enum  { kUnset = 0, kInternallySet, kMinimumUserStamp }
enum  ELimitType {
  UCAL_LIMIT_MINIMUM = 0, UCAL_LIMIT_GREATEST_MINIMUM, UCAL_LIMIT_LEAST_MAXIMUM, UCAL_LIMIT_MAXIMUM,
  UCAL_LIMIT_COUNT
}

Protected Member Functions

void complete (UErrorCode &status)
virtual void computeFields (UErrorCode &status)
void computeGregorianFields (int32_t julianDay, UErrorCode &ec)
int32_t computeJulianDay ()
int32_t computeMillisInDay ()
virtual void computeTime (UErrorCode &status)
int32_t computeZoneOffset (double millis, int32_t millisInDay, UErrorCode &ec)
virtual UDate defaultCenturyStart () const
virtual int32_t defaultCenturyStartYear () const
virtual int32_t getDefaultDayInMonth (int32_t eyear, int32_t month)
virtual int32_t getDefaultMonthInYear (int32_t eyear)
virtual const
UFieldResolutionTable * 
getFieldResolutionTable () const
int32_t getGregorianDayOfMonth () const
int32_t getGregorianDayOfYear () const
int32_t getGregorianMonth () const
int32_t getGregorianYear () const
virtual int32_t getLimit (UCalendarDateFields field, ELimitType limitType) const
int32_t getLocalDOW ()
double getTimeInMillis (UErrorCode &status) const
virtual void handleComputeFields (int32_t julianDay, UErrorCode &status)
virtual int32_t handleComputeJulianDay (UCalendarDateFields bestField)
virtual int32_t handleComputeMonthStart (int32_t eyear, int32_t month, UBool useMonth) const
virtual int32_t handleGetExtendedYear ()
virtual int32_t handleGetExtendedYearFromWeekFields (int32_t yearWoy, int32_t woy)
virtual int32_t handleGetLimit (UCalendarDateFields field, ELimitType limitType) const
virtual int32_t handleGetMonthLength (int32_t extendedYear, int32_t month) const
virtual int32_t handleGetYearLength (int32_t eyear) const
virtual UBool haveDefaultCentury () const
virtual UBool inDaylightTime (UErrorCode &status) const
int32_t internalGet (EDateFields field) const
int32_t internalGet (UCalendarDateFields field) const
int32_t internalGet (UCalendarDateFields field, int32_t defaultValue) const
UDate internalGetTime (void) const
void internalSet (UCalendarDateFields field, int32_t value)
void internalSet (EDateFields field, int32_t value)
void internalSetTime (UDate time)
UCalendarDateFields newerField (UCalendarDateFields defaultField, UCalendarDateFields alternateField) const
int32_t newestStamp (UCalendarDateFields start, UCalendarDateFields end, int32_t bestSoFar) const
virtual void pinField (UCalendarDateFields field, UErrorCode &status)
virtual void prepareGetActual (UCalendarDateFields field, UBool isMinimum, UErrorCode &status)
UCalendarDateFields resolveFields (const UFieldResolutionTable *precedenceTable)
void setTimeInMillis (double millis, UErrorCode &status)
int32_t weekNumber (int32_t dayOfPeriod, int32_t dayOfWeek)
int32_t weekNumber (int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek)

Static Protected Member Functions

static uint8_t julianDayToDayOfWeek (double julian)

Protected Attributes

UBool fAreAllFieldsSet
UBool fAreFieldsSet
UBool fAreFieldsVirtuallySet
int32_t fFields [UCAL_FIELD_COUNT]
UBool fIsSet [UCAL_FIELD_COUNT]
UBool fIsTimeSet
int32_t fStamp [UCAL_FIELD_COUNT]

Static Protected Attributes

static const UFieldResolutionTable kDatePrecedence []
static const UFieldResolutionTable kDOWPrecedence []
static const UFieldResolutionTable kYearPrecedence []

Private Member Functions

UDate internalGetDefaultCenturyStart (void) const
int32_t internalGetDefaultCenturyStartYear (void) const
int32_t yearType (int32_t year) const

Static Private Member Functions

static int32_t absoluteDayToDayOfWeek (int32_t day)
static void initializeSystemDefaultCentury (void)
static int32_t monthsInYear (int32_t year)
static int32_t startOfYear (int32_t year, UErrorCode &status)

Static Private Attributes

static const UDate fgSystemDefaultCentury = DBL_MIN
static UDate fgSystemDefaultCenturyStart = DBL_MIN
static int32_t fgSystemDefaultCenturyStartYear = -1
static const int32_t fgSystemDefaultCenturyYear = -1

Friends

class CalendarFactory
class CalendarService
class DefaultCalendarFactory

Detailed Description

HebrewCalendar is a subclass of Calendar that that implements the traditional Hebrew calendar. This is the civil calendar in Israel and the liturgical calendar of the Jewish faith worldwide.

The Hebrew calendar is lunisolar and thus has a number of interesting properties that distinguish it from the Gregorian. Months start on the day of (an arithmetic approximation of) each new moon. Since the solar year (approximately 365.24 days) is not an even multiple of the lunar month (approximately 29.53 days) an extra "leap month" is inserted in 7 out of every 19 years. To make matters even more interesting, the start of a year can be delayed by up to three days in order to prevent certain holidays from falling on the Sabbath and to prevent certain illegal year lengths. Finally, the lengths of certain months can vary depending on the number of days in the year.

The leap month is known as "Adar 1" and is inserted between the months of Shevat and Adar in leap years. Since the leap month does not come at the end of the year, calculations involving month numbers are particularly complex. Users of this class should make sure to use the roll and add methods rather than attempting to perform date arithmetic by manipulating the fields directly.

Note: In the traditional Hebrew calendar, days start at sunset. However, in order to keep the time fields in this class synchronized with those of the other calendars and with local clock time, we treat days and months as beginning at midnight, roughly 6 hours after the corresponding sunset.

If you are interested in more information on the rules behind the Hebrew calendar, see one of the following references:

See also:
com.ibm.icu.util.GregorianCalendar
Author:
Laura Werner
Alan Liu
Steven R. Loomis

Definition at line 83 of file hebrwcal.h.


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

Generated by  Doxygen 1.6.0   Back to index