com.ibm.icu.util
Class TaiwanCalendar

java.lang.Object
  extended by com.ibm.icu.util.Calendar
      extended by com.ibm.icu.util.GregorianCalendar
          extended by com.ibm.icu.util.TaiwanCalendar
All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class TaiwanCalendar
extends GregorianCalendar

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".

Author:
Laura Werner, Alan Liu, Steven R. Loomis
See Also:
Calendar, GregorianCalendar, Serialized Form
Status:
Stable ICU 3.8.

Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.icu.util.Calendar
Calendar.FormatConfiguration
 
Field Summary
static int BEFORE_MINGUO
          Constant for the Taiwan Era for years before Minguo 1.
static int MINGUO
          Constant for the Taiwan Era for Minguo.
 
Fields inherited from class com.ibm.icu.util.GregorianCalendar
AD, BC, invertGregorian, isGregorian
 
Fields inherited from class com.ibm.icu.util.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, 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, PM, RESOLVE_REMAP, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, UNSET, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, WEEKDAY, WEEKEND, WEEKEND_CEASE, WEEKEND_ONSET, YEAR, YEAR_WOY, ZONE_OFFSET
 
Constructor Summary
TaiwanCalendar()
          Constructs a TaiwanCalendar using the current time in the default time zone with the default locale.
TaiwanCalendar(Date date)
          Constructs a TaiwanCalendar with the given date set in the default time zone with the default locale.
TaiwanCalendar(int year, int month, int date)
          Constructs a TaiwanCalendar with 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(Locale aLocale)
          Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.
TaiwanCalendar(TimeZone zone)
          Constructs a TaiwanCalendar based on the current time in the given time zone with the default locale.
TaiwanCalendar(TimeZone zone, Locale aLocale)
          Constructs a TaiwanCalendar based on the current time in the given time zone with the given locale.
TaiwanCalendar(TimeZone zone, ULocale locale)
          Constructs a TaiwanCalendar based on the current time in the given time zone with the given locale.
TaiwanCalendar(ULocale locale)
          Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.
 
Method Summary
 String getType()
          Return the current Calendar type.
protected  void handleComputeFields(int julianDay)
          Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system.
protected  int handleGetExtendedYear()
          Return the extended year defined by the current fields.
protected  int handleGetLimit(int field, int limitType)
          Override GregorianCalendar.
 
Methods inherited from class com.ibm.icu.util.GregorianCalendar
getActualMaximum, getActualMinimum, getGregorianChange, handleComputeJulianDay, handleComputeMonthStart, handleGetMonthLength, handleGetYearLength, hashCode, isEquivalentTo, isLeapYear, roll, setGregorianChange
 
Methods inherited from class com.ibm.icu.util.Calendar
add, after, before, clear, clear, clone, compareTo, compareTo, complete, computeFields, computeGregorianFields, computeGregorianMonthStart, computeJulianDay, computeMillisInDay, computeTime, computeZoneOffset, equals, fieldDifference, fieldName, floorDivide, floorDivide, floorDivide, floorDivide, get, getAvailableLocales, getAvailableULocales, getDateTimeFormat, getDateTimeFormat, getDayOfWeekType, getDefaultDayInMonth, getDefaultMonthInYear, getDisplayName, getDisplayName, getFieldCount, getFieldResolutionTable, getFirstDayOfWeek, getGreatestMinimum, getGregorianDayOfMonth, getGregorianDayOfYear, getGregorianMonth, getGregorianYear, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getLeastMaximum, getLimit, getLocale, getMaximum, getMinimalDaysInFirstWeek, getMinimum, getStamp, getTime, getTimeInMillis, getTimeZone, getWeekendTransition, gregorianMonthLength, gregorianPreviousMonthLength, handleCreateFields, handleGetDateFormat, handleGetDateFormat, internalGet, internalGet, internalGetTimeInMillis, internalSet, isGregorianLeapYear, isLenient, isSet, isWeekend, isWeekend, julianDayToDayOfWeek, julianDayToMillis, millisToJulianDay, newerField, newestStamp, pinField, prepareGetActual, resolveFields, roll, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone, toString, validateField, validateField, validateFields, weekNumber, weekNumber
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BEFORE_MINGUO

public static final int BEFORE_MINGUO
Constant for the Taiwan Era for years before Minguo 1. Brefore Minuo 1 is Gregorian 1911, Before Minguo 2 is Gregorian 1910 and so on.

See Also:
Calendar.ERA, Constant Field Values
Status:
Stable ICU 3.8.

MINGUO

public static final int MINGUO
Constant for the Taiwan Era for Minguo. Minguo 1 is 1912 in Gregorian calendar.

See Also:
Calendar.ERA, Constant Field Values
Status:
Stable ICU 3.8.
Constructor Detail

TaiwanCalendar

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

Status:
Stable ICU 3.8.

TaiwanCalendar

public TaiwanCalendar(TimeZone zone)
Constructs a TaiwanCalendar based on the current time in the given time zone with the default locale.

Parameters:
zone - the given time zone.
Status:
Stable ICU 3.8.

TaiwanCalendar

public TaiwanCalendar(Locale aLocale)
Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.

Parameters:
aLocale - the given locale.
Status:
Stable ICU 3.8.

TaiwanCalendar

public TaiwanCalendar(ULocale locale)
Constructs a TaiwanCalendar based on the current time in the default time zone with the given locale.

Parameters:
locale - the given ulocale.
Status:
Stable ICU 3.8.

TaiwanCalendar

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 - the given time zone.
Status:
Stable ICU 3.8.

TaiwanCalendar

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 - the given time zone.
locale - the given ulocale.
Status:
Stable ICU 3.8.

TaiwanCalendar

public TaiwanCalendar(Date date)
Constructs a TaiwanCalendar with the given date set in the default time zone with the default locale.

Parameters:
date - The date to which the new calendar is set.
Status:
Stable ICU 3.8.

TaiwanCalendar

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 - The value used to set the calendar's YEAR time field.
month - The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January.
date - The value used to set the calendar's DATE time field.
Status:
Stable ICU 3.8.

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's YEAR time field.
month - The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January.
date - The value used to set the calendar's DATE time field.
hour - The value used to set the calendar's HOUR_OF_DAY time field.
minute - The value used to set the calendar's MINUTE time field.
second - The value used to set the calendar's SECOND time field.
Status:
Stable ICU 3.8.
Method Detail

handleGetExtendedYear

protected int handleGetExtendedYear()
Return 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:
handleGetExtendedYear in class GregorianCalendar
Returns:
the extended year
Status:
Stable ICU 3.8.

handleComputeFields

protected void handleComputeFields(int julianDay)
Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system. These are:

Overrides:
handleComputeFields in class GregorianCalendar
Status:
Stable ICU 3.8.

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:
handleGetLimit in class GregorianCalendar
Parameters:
field - one of the above field numbers
limitType - one of MINIMUM, GREATEST_MINIMUM, LEAST_MAXIMUM, or MAXIMUM
Status:
Stable ICU 3.8.

getType

public String getType()
Return the current Calendar type.

Overrides:
getType in class GregorianCalendar
Returns:
type of calendar
Status:
Stable ICU 3.8.


Copyright (c) 2009 IBM Corporation and others.