From f4a7861584dc511baab756fec28959ab10d5761e Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Fri, 17 Aug 2007 03:38:53 +0000 Subject: [PATCH] ICU-4567 Removed unnecessary virtual method implementations in Taiwan/Buddhist calendar. X-SVN-Rev: 22415 --- icu4c/source/i18n/buddhcal.cpp | 20 -------------------- icu4c/source/i18n/buddhcal.h | 20 -------------------- icu4c/source/i18n/taiwncal.cpp | 24 +----------------------- icu4c/source/i18n/taiwncal.h | 22 +--------------------- 4 files changed, 2 insertions(+), 84 deletions(-) diff --git a/icu4c/source/i18n/buddhcal.cpp b/icu4c/source/i18n/buddhcal.cpp index acf08cd865..a887cbff02 100644 --- a/icu4c/source/i18n/buddhcal.cpp +++ b/icu4c/source/i18n/buddhcal.cpp @@ -61,26 +61,6 @@ const char *BuddhistCalendar::getType() const return "buddhist"; } -int32_t -BuddhistCalendar::getMaximum(UCalendarDateFields field) const -{ - if(field == UCAL_ERA) { - return kMaxEra; - } else { - return GregorianCalendar::getMaximum(field); - } -} - -int32_t -BuddhistCalendar::getLeastMaximum(UCalendarDateFields field) const -{ - if(field == UCAL_ERA) { - return kMaxEra; - } else { - return GregorianCalendar::getLeastMaximum(field); - } -} - int32_t BuddhistCalendar::handleGetExtendedYear() { // EXTENDED_YEAR in BuddhistCalendar is a Gregorian year. diff --git a/icu4c/source/i18n/buddhcal.h b/icu4c/source/i18n/buddhcal.h index 0c95a15d35..735f61890a 100644 --- a/icu4c/source/i18n/buddhcal.h +++ b/icu4c/source/i18n/buddhcal.h @@ -128,26 +128,6 @@ public: */ virtual const char * getType() const; - /** - * Gets the maximum value for the given time field. e.g. for DAY_OF_MONTH, - * 31. - * - * @param field The given time field. - * @return The maximum value for the given time field. - * @draft ICU 2.6 - */ - int32_t getMaximum(UCalendarDateFields field) const; - - /** - * Gets the lowest maximum value for the given field if varies. Otherwise same as - * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28. - * - * @param field The given time field. - * @return The lowest maximum value for the given time field. - * @draft ICU 2.6 - */ - int32_t getLeastMaximum(UCalendarDateFields field) const; - private: BuddhistCalendar(); // default constructor not implemented diff --git a/icu4c/source/i18n/taiwncal.cpp b/icu4c/source/i18n/taiwncal.cpp index c28a755c77..60098c15fd 100644 --- a/icu4c/source/i18n/taiwncal.cpp +++ b/icu4c/source/i18n/taiwncal.cpp @@ -25,8 +25,6 @@ U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TaiwanCalendar) -static const int32_t kMaxEra = 1; // 1 eras - static const int32_t kTaiwanEraStart = 1911; // 1911 (Gregorian) static const int32_t kGregorianEpoch = 1970; @@ -62,26 +60,6 @@ const char *TaiwanCalendar::getType() const return "taiwan"; } -int32_t -TaiwanCalendar::getMaximum(UCalendarDateFields field) const -{ - if(field == UCAL_ERA) { - return kMaxEra; - } else { - return GregorianCalendar::getMaximum(field); - } -} - -int32_t -TaiwanCalendar::getLeastMaximum(UCalendarDateFields field) const -{ - if(field == UCAL_ERA) { - return kMaxEra; - } else { - return GregorianCalendar::getLeastMaximum(field); - } -} - int32_t TaiwanCalendar::handleGetExtendedYear() { // EXTENDED_YEAR in TaiwanCalendar is a Gregorian year @@ -92,7 +70,7 @@ int32_t TaiwanCalendar::handleGetExtendedYear() && newerField(UCAL_EXTENDED_YEAR, UCAL_ERA) == UCAL_EXTENDED_YEAR) { year = internalGet(UCAL_EXTENDED_YEAR, kGregorianEpoch); } else { - int32_t era = internalGetEra(); + int32_t era = internalGet(UCAL_ERA, MINGUO); if(era == MINGUO) { year = internalGet(UCAL_YEAR, 1) + kTaiwanEraStart; } else if(era == BEFORE_MINGUO) { diff --git a/icu4c/source/i18n/taiwncal.h b/icu4c/source/i18n/taiwncal.h index f5b1b28545..fe6f89b190 100644 --- a/icu4c/source/i18n/taiwncal.h +++ b/icu4c/source/i18n/taiwncal.h @@ -125,31 +125,11 @@ public: */ virtual const char * getType() const; - /** - * Gets the maximum value for the given time field. e.g. for DAY_OF_MONTH, - * 31. - * - * @param field The given time field. - * @return The maximum value for the given time field. - * @draft ICU 2.6 - */ - int32_t getMaximum(UCalendarDateFields field) const; - - /** - * Gets the lowest maximum value for the given field if varies. Otherwise same as - * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28. - * - * @param field The given time field. - * @return The lowest maximum value for the given time field. - * @draft ICU 2.6 - */ - int32_t getLeastMaximum(UCalendarDateFields field) const; - private: TaiwanCalendar(); // default constructor not implemented protected: - /** + /** * Return the extended year defined by the current fields. This will * use the UCAL_EXTENDED_YEAR field or the UCAL_YEAR and supra-year fields (such * as UCAL_ERA) specific to the calendar system, depending on which set of