Top Description Fields Constructors Methods
com.ibm.icu.util

public Class TaiwanCalendar

extends GregorianCalendar
Class Inheritance
Imports
java.util.Date, .Locale

TaiwanCalendar is a subclass of GregorianCalendar that numbers years since 1912.

The Taiwan calendar is identical to the Gregorian calendar in all respects except for the year and era. Years are numbered since 1912 AD (Gregorian).

The Taiwan Calendar has one era: MINGUO.

This class should not be subclassed.

TaiwanCalendar usually should be instantiated using com.ibm.icu.util.Calendar#getInstance(ULocale) passing in a ULocale with the tag "@calendar=roc".

Authors
Laura Werner, Alan Liu, Steven R. Loomis
ICU Status
Stable since ICU 3.8.
See Also
com.ibm.icu.util.Calendar, com.ibm.icu.util.GregorianCalendar

Field Summary

Modifier and TypeField and Description
public static final int
BEFORE_MINGUO

Constant for the Taiwan Era for years before Minguo 1.

private static final int
public static final int
MINGUO

Constant for the Taiwan Era for Minguo.

private static final long
private static final int
Inherited from com.ibm.icu.util.GregorianCalendar:
ADBCinvertGregorianisGregorian

Constructor Summary

AccessConstructor and Description
public
TaiwanCalendar()

Constructs a TaiwanCalendar using the current time in the default time zone with the default locale.

public
TaiwanCalendar(TimeZone
the given time zone.
zone
)

Constructs a TaiwanCalendar based on the current time in the given time zone with the default locale.

public
TaiwanCalendar(Locale
the given locale.
aLocale
)

Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.

public
TaiwanCalendar(ULocale
the given ulocale.
locale
)

Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.

public
TaiwanCalendar(TimeZone
the given time zone.
zone
,
Locale aLocale)

Constructs a TaiwanCalendar based on the current time in the given time zone with the given locale.

public
TaiwanCalendar(TimeZone
the given time zone.
zone
,
ULocale
the given ulocale.
locale
)

Constructs a TaiwanCalendar based on the current time in the given time zone with the given locale.

public
TaiwanCalendar(Date
The date to which the new calendar is set.
date
)

Constructs a TaiwanCalendar with the given date set in the default time zone with the default locale.

public
TaiwanCalendar(int
The value used to set the calendar's YEAR time field.
year
,
int
The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January.
month
,
int
The value used to set the calendar's DATE time field.
date
)

Constructs a TaiwanCalendar with the given date set in the default time zone with the default locale.

public
TaiwanCalendar(int
The value used to set the calendar's YEAR time field.
year
,
int
The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January.
month
,
int
The value used to set the calendar's DATE time field.
date
,
int
The value used to set the calendar's HOUR_OF_DAY time field.
hour
,
int
The value used to set the calendar's MINUTE time field.
minute
,
int
The value used to set the calendar's SECOND time field.
second
)

Constructs a TaiwanCalendar with the given date and time set for the default time zone with the default locale.

Method Summary

Modifier and TypeMethod and Description
public String
protected void
handleComputeFields(int julianDay)

Overrides com.ibm.icu.util.GregorianCalendar.handleComputeFields.

Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system.
protected int
handleGetExtendedYear()

Overrides com.ibm.icu.util.GregorianCalendar.handleGetExtendedYear.

Returns the extended year defined by the current fields.
protected int
handleGetLimit(int
one of the above field numbers
field
,
int
one of MINIMUM, GREATEST_MINIMUM, LEAST_MAXIMUM, or MAXIMUM
limitType
)

Overrides com.ibm.icu.util.GregorianCalendar.handleGetLimit.

Override GregorianCalendar.
Inherited from com.ibm.icu.util.GregorianCalendar:
getActualMaximumgetActualMinimumgetGregorianChangehandleComputeJulianDayhandleComputeMonthStarthandleGetMonthLengthhandleGetYearLengthhashCodeinDaylightTimeisEquivalentToisLeapYearrollsetGregorianChange

Field Detail

BEFORE_MINGUOback to summary
public static final int BEFORE_MINGUO

Constant for the Taiwan Era for years before Minguo 1. Before Minuo 1 is Gregorian 1911, Before Minguo 2 is Gregorian 1910 and so on.

ICU Status
Stable since ICU 3.8.
See Also
com.ibm.icu.util.Calendar#ERA
GREGORIAN_EPOCHback to summary
private static final int GREGORIAN_EPOCH
MINGUOback to summary
public static final int MINGUO

Constant for the Taiwan Era for Minguo. Minguo 1 is 1912 in Gregorian calendar.

ICU Status
Stable since ICU 3.8.
See Also
com.ibm.icu.util.Calendar#ERA
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.ibm.icu.util.GregorianCalendar.serialVersionUID.

Taiwan_ERA_STARTback to summary
private static final int Taiwan_ERA_START

Constructor Detail

TaiwanCalendarback to summary
public TaiwanCalendar()

Constructs a TaiwanCalendar using the current time in the default time zone with the default locale.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(TimeZone zone)

Constructs a TaiwanCalendar based on the current time in the given time zone with the default locale.

Parameters
zone:TimeZone

the given time zone.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(Locale aLocale)

Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.

Parameters
aLocale:Locale

the given locale.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(ULocale locale)

Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.

Parameters
locale:ULocale

the given ulocale.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(TimeZone zone, Locale aLocale)

Constructs a TaiwanCalendar based on the current time in the given time zone with the given locale.

Parameters
zone:TimeZone

the given time zone.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(TimeZone zone, ULocale locale)

Constructs a TaiwanCalendar based on the current time in the given time zone with the given locale.

Parameters
zone:TimeZone

the given time zone.

locale:ULocale

the given ulocale.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(Date date)

Constructs a TaiwanCalendar with the given date set in the default time zone with the default locale.

Parameters
date:Date

The date to which the new calendar is set.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(int year, int month, int date)

Constructs a TaiwanCalendar with the given date set in the default time zone with the default locale.

Parameters
year:int

The value used to set the calendar's YEAR time field.

month:int

The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January.

date:int

The value used to set the calendar's DATE time field.

ICU Status
Stable since ICU 3.8.
TaiwanCalendarback to summary
public TaiwanCalendar(int year, int month, int date, int hour, int minute, int second)

Constructs a TaiwanCalendar with the given date and time set for the default time zone with the default locale.

Parameters
year:int

The value used to set the calendar's YEAR time field.

month:int

The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January.

date:int

The value used to set the calendar's DATE time field.

hour:int

The value used to set the calendar's HOUR_OF_DAY time field.

minute:int

The value used to set the calendar's MINUTE time field.

second:int

The value used to set the calendar's SECOND time field.

ICU Status
Stable since ICU 3.8.

Method Detail

getTypeback to summary
public String getType()

Overrides com.ibm.icu.util.GregorianCalendar.getType.

Doc from com.ibm.icu.util.GregorianCalendar.getType.

ICU

Returns the calendar type name string for this Calendar object. The returned string is the legacy ICU calendar attribute value, for example, "gregorian" or "japanese".

See type="old type name" for the calendar attribute of locale IDs at http://www.unicode.org/reports/tr35/#Key_Type_Definitions

Returns:String

Doc from com.ibm.icu.util.Calendar.getType.

legacy calendar type name string

ICU Status
Stable since ICU 3.8.
handleComputeFieldsback to summary
protected void handleComputeFields(int julianDay)

Overrides com.ibm.icu.util.GregorianCalendar.handleComputeFields.

Doc from com.ibm.icu.util.GregorianCalendar.handleComputeFields.

Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system. These are:

  • ERA
  • YEAR
  • MONTH
  • DAY_OF_MONTH
  • DAY_OF_YEAR
  • EXTENDED_YEAR
ICU Status
Stable since ICU 3.8.
handleGetExtendedYearback to summary
protected int handleGetExtendedYear()

Overrides com.ibm.icu.util.GregorianCalendar.handleGetExtendedYear.

Doc from com.ibm.icu.util.Calendar.handleGetExtendedYear.

Returns the extended year defined by the current fields. This will use the EXTENDED_YEAR field or the YEAR and supra-year fields (such as ERA) specific to the calendar system, depending on which set of fields is newer.

Returns:int

the extended year

ICU Status
Stable since ICU 3.8.
handleGetLimitback to summary
protected int handleGetLimit(int field, int limitType)

Overrides com.ibm.icu.util.GregorianCalendar.handleGetLimit.

Override GregorianCalendar. There is only one Taiwan ERA. We should really handle YEAR, YEAR_WOY, and EXTENDED_YEAR here too to implement the 1..5000000 range, but it's not critical.

Parameters
field:int

Doc from com.ibm.icu.util.Calendar.handleGetLimit.

one of the above field numbers

limitType:int

Doc from com.ibm.icu.util.Calendar.handleGetLimit.

one of MINIMUM, GREATEST_MINIMUM, LEAST_MAXIMUM, or MAXIMUM

ICU Status
Stable since ICU 3.8.