ICU-4567 Removed unnecessary virtual method implementations in Taiwan/Buddhist calendar.
X-SVN-Rev: 22415
This commit is contained in:
parent
2552d04edc
commit
f4a7861584
@ -61,26 +61,6 @@ const char *BuddhistCalendar::getType() const
|
|||||||
return "buddhist";
|
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()
|
int32_t BuddhistCalendar::handleGetExtendedYear()
|
||||||
{
|
{
|
||||||
// EXTENDED_YEAR in BuddhistCalendar is a Gregorian year.
|
// EXTENDED_YEAR in BuddhistCalendar is a Gregorian year.
|
||||||
|
@ -128,26 +128,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual const char * getType() const;
|
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:
|
private:
|
||||||
BuddhistCalendar(); // default constructor not implemented
|
BuddhistCalendar(); // default constructor not implemented
|
||||||
|
|
||||||
|
@ -25,8 +25,6 @@ U_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TaiwanCalendar)
|
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 kTaiwanEraStart = 1911; // 1911 (Gregorian)
|
||||||
|
|
||||||
static const int32_t kGregorianEpoch = 1970;
|
static const int32_t kGregorianEpoch = 1970;
|
||||||
@ -62,26 +60,6 @@ const char *TaiwanCalendar::getType() const
|
|||||||
return "taiwan";
|
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()
|
int32_t TaiwanCalendar::handleGetExtendedYear()
|
||||||
{
|
{
|
||||||
// EXTENDED_YEAR in TaiwanCalendar is a Gregorian year
|
// 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) {
|
&& newerField(UCAL_EXTENDED_YEAR, UCAL_ERA) == UCAL_EXTENDED_YEAR) {
|
||||||
year = internalGet(UCAL_EXTENDED_YEAR, kGregorianEpoch);
|
year = internalGet(UCAL_EXTENDED_YEAR, kGregorianEpoch);
|
||||||
} else {
|
} else {
|
||||||
int32_t era = internalGetEra();
|
int32_t era = internalGet(UCAL_ERA, MINGUO);
|
||||||
if(era == MINGUO) {
|
if(era == MINGUO) {
|
||||||
year = internalGet(UCAL_YEAR, 1) + kTaiwanEraStart;
|
year = internalGet(UCAL_YEAR, 1) + kTaiwanEraStart;
|
||||||
} else if(era == BEFORE_MINGUO) {
|
} else if(era == BEFORE_MINGUO) {
|
||||||
|
@ -125,31 +125,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual const char * getType() const;
|
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:
|
private:
|
||||||
TaiwanCalendar(); // default constructor not implemented
|
TaiwanCalendar(); // default constructor not implemented
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Return the extended year defined by the current fields. This will
|
* 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
|
* 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
|
* as UCAL_ERA) specific to the calendar system, depending on which set of
|
||||||
|
Loading…
Reference in New Issue
Block a user