Class TaiwanCalendar
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.util.Calendar
org.graalvm.shadowed.com.ibm.icu.util.GregorianCalendar
org.graalvm.shadowed.com.ibm.icu.util.TaiwanCalendar
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<Calendar>
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
Calendar.getInstance(ULocale) passing in a ULocale
with the tag "@calendar=roc".
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Calendar
Calendar.FormatConfiguration, Calendar.WeekData -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant for the Taiwan Era for years before Minguo 1.static final intConstant for the Taiwan Era for Minguo.Fields inherited from class GregorianCalendar
AD, BC, invertGregorian, isGregorianFields inherited from class Calendar
AM, AM_PM, APRIL, AUGUST, BASE_FIELD_COUNT, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DOW_LOCAL, DST_OFFSET, EPOCH_JULIAN_DAY, ERA, EXTENDED_YEAR, FEBRUARY, FRIDAY, GREATEST_MINIMUM, HOUR, HOUR_OF_DAY, INTERNALLY_SET, IS_LEAP_MONTH, JAN_1_1_JULIAN_DAY, JANUARY, JULIAN_DAY, JULY, JUNE, LEAST_MAXIMUM, MARCH, MAX_DATE, MAX_FIELD_COUNT, MAX_JULIAN, MAX_MILLIS, MAXIMUM, MAY, MILLISECOND, MILLISECONDS_IN_DAY, MIN_DATE, MIN_JULIAN, MIN_MILLIS, MINIMUM, MINIMUM_USER_STAMP, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ORDINAL_MONTH, PM, RESOLVE_REMAP, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, UNSET, WALLTIME_FIRST, WALLTIME_LAST, WALLTIME_NEXT_VALID, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, WEEKDAY, WEEKEND, WEEKEND_CEASE, WEEKEND_ONSET, YEAR, YEAR_WOY, ZONE_OFFSET -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aTaiwanCalendarusing the current time in the default time zone with the default locale.TaiwanCalendar(int year, int month, int date) Constructs aTaiwanCalendarwith the given date set in the default time zone with the default locale.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.TaiwanCalendar(Date date) Constructs aTaiwanCalendarwith the given date set in the default time zone with the default locale.TaiwanCalendar(Locale aLocale) Constructs aTaiwanCalendarbased on the current time in the default time zone with the given locale.TaiwanCalendar(TimeZone zone) Constructs aTaiwanCalendarbased on the current time in the given time zone with the default locale.TaiwanCalendar(TimeZone zone, Locale aLocale) Constructs aTaiwanCalendarbased on the current time in the given time zone with the given locale.TaiwanCalendar(TimeZone zone, ULocale locale) Constructs aTaiwanCalendarbased on the current time in the given time zone with the given locale.TaiwanCalendar(ULocale locale) Constructs aTaiwanCalendarbased on the current time in the default time zone with the given locale. -
Method Summary
Modifier and TypeMethodDescriptiongetType()Returns the calendar type name string for this Calendar object.protected voidhandleComputeFields(int julianDay) Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system.protected intReturns the extended year defined by the current fields.protected inthandleGetLimit(int field, int limitType) Override GregorianCalendar.Methods inherited from class GregorianCalendar
getActualMaximum, getActualMinimum, getGregorianChange, handleComputeJulianDay, handleComputeMonthStart, handleGetMonthLength, handleGetYearLength, hashCode, isEquivalentTo, isEra0CountingBackward, isLeapYear, roll, setGregorianChangeMethods inherited from class Calendar
add, after, before, clear, clear, clone, compareTo, complete, computeFields, computeGregorianFields, computeGregorianMonthStart, computeJulianDay, computeMillisInDay, computeMillisInDayLong, computeTime, computeZoneOffset, computeZoneOffset, equals, fieldDifference, fieldName, floorDivide, floorDivide, floorDivide, floorDivide, get, getAvailableLocales, getAvailableULocales, getDateAtTimePattern, getDateTimeFormat, getDateTimeFormat, getDateTimePattern, getDayOfWeekType, getDefaultDayInMonth, getDefaultMonthInYear, getDisplayName, getDisplayName, getFieldCount, getFieldResolutionTable, getFirstDayOfWeek, getGreatestMinimum, getGregorianDayOfMonth, getGregorianDayOfYear, getGregorianMonth, getGregorianYear, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getKeywordValuesForLocale, getLeastMaximum, getLimit, getLocale, getMaximum, getMinimalDaysInFirstWeek, getMinimum, getRelatedYear, getRepeatedWallTimeOption, getSkippedWallTimeOption, getStamp, getTemporalMonthCode, getTime, getTimeInMillis, getTimeZone, getWeekData, getWeekDataForRegion, getWeekendTransition, gregorianMonthLength, gregorianPreviousMonthLength, handleCreateFields, handleGetDateFormat, handleGetDateFormat, handleGetDateFormat, handleGetDateFormat, haveDefaultCentury, inTemporalLeapYear, internalGet, internalGet, internalGetMonth, internalGetMonth, internalGetTimeInMillis, internalSet, isGregorianLeapYear, isLenient, isSet, isWeekend, isWeekend, julianDayToDayOfWeek, julianDayToMillis, millisToJulianDay, newerField, newestStamp, pinField, prepareGetActual, resolveFields, roll, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setRelatedYear, setRepeatedWallTimeOption, setSkippedWallTimeOption, setTemporalMonthCode, setTime, setTimeInMillis, setTimeZone, setWeekData, toString, validateField, validateField, validateFields, weekNumber, weekNumber
-
Field Details
-
BEFORE_MINGUO
public static final int BEFORE_MINGUOConstant for the Taiwan Era for years before Minguo 1. Before Minuo 1 is Gregorian 1911, Before Minguo 2 is Gregorian 1910 and so on.- See Also:
-
MINGUO
public static final int MINGUOConstant for the Taiwan Era for Minguo. Minguo 1 is 1912 in Gregorian calendar.- See Also:
-
-
Constructor Details
-
TaiwanCalendar
public TaiwanCalendar()Constructs aTaiwanCalendarusing the current time in the default time zone with the default locale. -
TaiwanCalendar
Constructs aTaiwanCalendarbased on the current time in the given time zone with the default locale.- Parameters:
zone- the given time zone.
-
TaiwanCalendar
Constructs aTaiwanCalendarbased on the current time in the default time zone with the given locale.- Parameters:
aLocale- the given locale.
-
TaiwanCalendar
Constructs aTaiwanCalendarbased on the current time in the default time zone with the given locale.- Parameters:
locale- the given ulocale.
-
TaiwanCalendar
-
TaiwanCalendar
-
TaiwanCalendar
Constructs aTaiwanCalendarwith the given date set in the default time zone with the default locale.- Parameters:
date- The date to which the new calendar is set.
-
TaiwanCalendar
public TaiwanCalendar(int year, int month, int date) Constructs aTaiwanCalendarwith the given date set in the default time zone with the default locale. -
TaiwanCalendar
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- The value used to set the calendar'sYEARtime field.month- The value used to set the calendar'sMONTHtime field. The value is 0-based. e.g., 0 for January.date- The value used to set the calendar'sDATEtime field.hour- The value used to set the calendar'sHOUR_OF_DAYtime field.minute- The value used to set the calendar'sMINUTEtime field.second- The value used to set the calendar'sSECONDtime field.
-
-
Method Details
-
handleGetExtendedYear
protected int 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.- Overrides:
handleGetExtendedYearin classGregorianCalendar- Returns:
- the extended year
-
handleComputeFields
protected void handleComputeFields(int julianDay) 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
- Overrides:
handleComputeFieldsin classGregorianCalendar
-
handleGetLimit
protected int handleGetLimit(int field, int limitType) 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.- Overrides:
handleGetLimitin classGregorianCalendar- Parameters:
field- one of the above field numberslimitType- one ofMINIMUM,GREATEST_MINIMUM,LEAST_MAXIMUM, orMAXIMUM
-
getType
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
- Overrides:
getTypein classGregorianCalendar- Returns:
- legacy calendar type name string
-