Logo Search packages:      
Sourcecode: icu version File versions

void Calendar::handleComputeFields ( int32_t  julianDay,
UErrorCode status 
) [protected, virtual, inherited]

Subclasses may override this method to compute several fields specific to each calendar system. These are:

  • ERA
  • YEAR
  • MONTH
  • DAY_OF_MONTH
  • DAY_OF_YEAR
  • EXTENDED_YEAR

Subclasses can refer to the DAY_OF_WEEK and DOW_LOCAL fields, which will be set when this method is called. Subclasses can also call the getGregorianXxx() methods to obtain Gregorian calendar equivalents for the given Julian day.

In addition, subclasses should compute any subclass-specific fields, that is, fields from BASE_FIELD_COUNT to getFieldCount() - 1.

The default implementation in Calendar implements a pure proleptic Gregorian calendar.

For internal use only.

Reimplemented in BuddhistCalendar, ChineseCalendar, CopticCalendar, EthiopicCalendar, HebrewCalendar, IndianCalendar, IslamicCalendar, JapaneseCalendar, PersianCalendar, TaiwanCalendar, and GregorianCalendar.

Definition at line 1429 of file calendar.cpp.

References Calendar::getGregorianDayOfMonth(), Calendar::getGregorianDayOfYear(), Calendar::getGregorianMonth(), Calendar::getGregorianYear(), Calendar::internalSet(), UCAL_DAY_OF_MONTH, UCAL_DAY_OF_YEAR, UCAL_ERA, UCAL_EXTENDED_YEAR, UCAL_MONTH, and UCAL_YEAR.

Referenced by Calendar::computeFields().

{
    internalSet(UCAL_MONTH, getGregorianMonth());
    internalSet(UCAL_DAY_OF_MONTH, getGregorianDayOfMonth());
    internalSet(UCAL_DAY_OF_YEAR, getGregorianDayOfYear());
    int32_t eyear = getGregorianYear();
    internalSet(UCAL_EXTENDED_YEAR, eyear);
    int32_t era = GregorianCalendar::AD;
    if (eyear < 1) {
        era = GregorianCalendar::BC;
        eyear = 1 - eyear;
    }
    internalSet(UCAL_ERA, era);
    internalSet(UCAL_YEAR, eyear);
}


Generated by  Doxygen 1.6.0   Back to index