Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / icu / source / i18n / unicode / calendar.h
index 5aa5ff9..b3c9587 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ********************************************************************************
-*   Copyright (C) 1997-2010, International Business Machines
+*   Copyright (C) 1997-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 ********************************************************************************
 *
@@ -48,6 +48,7 @@ class ICUServiceFactory;
  */
 typedef int32_t UFieldResolutionTable[12][8];
 
+class BasicTimeZone;
 /**
  * <code>Calendar</code> is an abstract base class for converting between
  * a <code>UDate</code> object and a set of integer fields such as
@@ -85,11 +86,12 @@ typedef int32_t UFieldResolutionTable[12][8];
  * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
  *
  * <p>
- * When computing a <code>UDate</code> from time fields, two special circumstances
+ * When computing a <code>UDate</code> from time fields, some special circumstances
  * may arise: there may be insufficient information to compute the
  * <code>UDate</code> (such as only year and month but no day in the month),
- * or there may be inconsistent information (such as "Tuesday, July 15, 1996"
- * -- July 15, 1996 is actually a Monday).
+ * there may be inconsistent information (such as "Tuesday, July 15, 1996"
+ * -- July 15, 1996 is actually a Monday), or the input time might be ambiguous
+ * because of time zone transition.
  *
  * <p>
  * <strong>Insufficient information.</strong> The calendar will use default
@@ -124,6 +126,26 @@ typedef int32_t UFieldResolutionTable[12][8];
  * \htmlonly</blockquote>\endhtmlonly
  *
  * <p>
+ * <strong>Ambiguous Wall Clock Time.</strong> When time offset from UTC has
+ * changed, it produces ambiguous time slot around the transition. For example,
+ * many US locations observe daylight saving time. On the date switching to daylight
+ * saving time in US, wall clock time jumps from 1:00 AM (standard) to 2:00 AM
+ * (daylight). Therefore, wall clock time from 1:00 AM to 1:59 AM do not exist on
+ * the date. When the input wall time fall into this missing time slot, the ICU
+ * Calendar resolves the time using the UTC offset before the transition by default.
+ * In this example, 1:30 AM is interpreted as 1:30 AM standard time (non-exist),
+ * so the final result will be 2:30 AM daylight time.
+ * 
+ * <p>On the date switching back to standard time, wall clock time is moved back one
+ * hour at 2:00 AM. So wall clock time from 1:00 AM to 1:59 AM occur twice. In this
+ * case, the ICU Calendar resolves the time using the UTC offset after the transition
+ * by default. For example, 1:30 AM on the date is resolved as 1:30 AM standard time.
+ *
+ * <p>Ambiguous wall clock time resolution behaviors can be customized by Calendar APIs
+ * {@link #setRepeatedWallTimeOption} and {@link #setSkippedWallTimeOption}.
+ * These methods are available in ICU 49 or later versions.
+ *
+ * <p>
  * <strong>Note:</strong> for some non-Gregorian calendars, different
  * fields may be necessary for complete disambiguation. For example, a full
  * specification of the historial Arabic astronomical calendar requires year,
@@ -160,6 +182,19 @@ typedef int32_t UFieldResolutionTable[12][8];
  * For example, subtracting 5 days from the date <code>September 12, 1996</code>
  * results in <code>September 7, 1996</code>.
  *
+ * <p><big><b>Supported range</b></big>
+ *
+ * <p>The allowable range of <code>Calendar</code> has been
+ * narrowed. <code>GregorianCalendar</code> used to attempt to support
+ * the range of dates with millisecond values from
+ * <code>Long.MIN_VALUE</code> to <code>Long.MAX_VALUE</code>.
+ * The new <code>Calendar</code> protocol specifies the
+ * maximum range of supportable dates as those having Julian day numbers
+ * of <code>-0x7F000000</code> to <code>+0x7F000000</code>. This
+ * corresponds to years from ~5,800,000 BCE to ~5,800,000 CE. Programmers
+ * should use the protected constants in <code>Calendar</code> to
+ * specify an extremely early or extremely late date.</p>
+ *
  * @stable ICU 2.0
  */
 class U_I18N_API Calendar : public UObject {
@@ -208,6 +243,7 @@ public:
 #endif /* U_HIDE_DEPRECATED_API */
     };
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients
      * who create locale resources for the field of first-day-of-week should be aware of
@@ -215,7 +251,6 @@ public:
      * @deprecated ICU 2.6. Use C enum UCalendarDaysOfWeek defined in ucal.h
      */
     enum EDaysOfWeek {
-#ifndef U_HIDE_DEPRECATED_API
         SUNDAY = 1,
         MONDAY,
         TUESDAY,
@@ -223,7 +258,6 @@ public:
         THURSDAY,
         FRIDAY,
         SATURDAY
-#endif /* U_HIDE_DEPRECATED_API */
     };
 
     /**
@@ -231,7 +265,6 @@ public:
      * @deprecated ICU 2.6. Use C enum UCalendarMonths defined in ucal.h
      */
     enum EMonths {
-#ifndef U_HIDE_DEPRECATED_API
         JANUARY,
         FEBRUARY,
         MARCH,
@@ -245,7 +278,6 @@ public:
         NOVEMBER,
         DECEMBER,
         UNDECIMBER
-#endif /* U_HIDE_DEPRECATED_API */
     };
 
     /**
@@ -253,11 +285,10 @@ public:
      * @deprecated ICU 2.6. Use C enum UCalendarAMPMs defined in ucal.h
      */
     enum EAmpm {
-#ifndef U_HIDE_DEPRECATED_API
         AM,
         PM
-#endif /* U_HIDE_DEPRECATED_API */
     };
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * destructor
@@ -344,7 +375,7 @@ public:
      * Gets a Calendar using the given timezone and given locale.  The TimeZone
      * is _not_ adopted; the client is still responsible for deleting it.
      *
-     * @param zoneToAdopt  The given timezone to be adopted.
+     * @param zone         The given timezone.
      * @param aLocale      The given locale.
      * @param success      Indicates the success/failure of Calendar creation. Filled in
      *                     with U_ZERO_ERROR if created successfully, set to a failure result
@@ -352,7 +383,7 @@ public:
      * @return             A Calendar if created successfully. NULL otherwise.
      * @stable ICU 2.0
      */
-    static Calendar* U_EXPORT2 createInstance(const TimeZone& zoneToAdopt, const Locale& aLocale, UErrorCode& success);
+    static Calendar* U_EXPORT2 createInstance(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
 
     /**
      * Returns a list of the locales for which Calendars are installed.
@@ -509,6 +540,9 @@ public:
      * the month or Calendar::MONTH field, other fields like date might conflict and
      * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
      * in 02/29/96.
+     * Adding a positive value always means moving forward in time, so for the Gregorian calendar,
+     * starting with 100 BC and adding +1 to year results in 99 BC (even though this actually reduces
+     * the numeric value of the field itself).
      *
      * @param field   Specifies which date field to modify.
      * @param amount  The amount of time to be added to the field, in the natural unit
@@ -528,6 +562,9 @@ public:
      * the month or Calendar::MONTH field, other fields like date might conflict and
      * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
      * in 02/29/96.
+     * Adding a positive value always means moving forward in time, so for the Gregorian calendar,
+     * starting with 100 BC and adding +1 to year results in 99 BC (even though this actually reduces
+     * the numeric value of the field itself).
      *
      * @param field   Specifies which date field to modify.
      * @param amount  The amount of time to be added to the field, in the natural unit
@@ -540,6 +577,7 @@ public:
      */
     virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode& status);
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
      * time field. For example, to roll the current date up by one day, call
@@ -548,10 +586,19 @@ public:
      * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
      * Calendar::MONTH field, other fields like date might conflict and, need to be
      * changed. For instance, rolling the month up on the date 01/31/96 will result in
-     * 02/29/96. Rolling up always means rolling forward in time; e.g., rolling the year
-     * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
-     * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
-     * between 0 and 23, which is zero-based.
+     * 02/29/96. Rolling up always means rolling forward in time (unless the limit of the
+     * field is reached, in which case it may pin or wrap), so for Gregorian calendar,
+     * starting with 100 BC and rolling the year up results in 99 BC.
+     * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+     * most eras in the Japanese calendar) then rolling the year past either limit of the
+     * era will cause the year to wrap around. When eras only have a limit at one end,
+     * then attempting to roll the year past that limit will result in pinning the year
+     * at that limit. Note that for most calendars in which era 0 years move forward in
+     * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+     * result in negative years for era 0 (that is the only way to represent years before
+     * the calendar epoch).
+     * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+     * hour value in the range between 0 and 23, which is zero-based.
      * <P>
      * NOTE: Do not use this method -- use roll(EDateFields, int, UErrorCode&) instead.
      *
@@ -564,6 +611,7 @@ public:
      * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, UBool up, UErrorCode& status) instead.
      */
     inline void roll(EDateFields field, UBool up, UErrorCode& status);
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
@@ -573,10 +621,19 @@ public:
      * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
      * Calendar::MONTH field, other fields like date might conflict and, need to be
      * changed. For instance, rolling the month up on the date 01/31/96 will result in
-     * 02/29/96. Rolling up always means rolling forward in time; e.g., rolling the year
-     * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
-     * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
-     * between 0 and 23, which is zero-based.
+     * 02/29/96. Rolling up always means rolling forward in time (unless the limit of the
+     * field is reached, in which case it may pin or wrap), so for Gregorian calendar,
+     * starting with 100 BC and rolling the year up results in 99 BC.
+     * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+     * most eras in the Japanese calendar) then rolling the year past either limit of the
+     * era will cause the year to wrap around. When eras only have a limit at one end,
+     * then attempting to roll the year past that limit will result in pinning the year
+     * at that limit. Note that for most calendars in which era 0 years move forward in
+     * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+     * result in negative years for era 0 (that is the only way to represent years before
+     * the calendar epoch).
+     * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+     * hour value in the range between 0 and 23, which is zero-based.
      * <P>
      * NOTE: Do not use this method -- use roll(UCalendarDateFields, int, UErrorCode&) instead.
      *
@@ -596,10 +653,19 @@ public:
      * roll(Calendar::DATE, +1, status). When rolling on the month or
      * Calendar::MONTH field, other fields like date might conflict and, need to be
      * changed. For instance, rolling the month up on the date 01/31/96 will result in
-     * 02/29/96.  Rolling by a positive value always means rolling forward in time;
-     * e.g., rolling the year by +1 on "100 BC" will result in "99 BC", for Gregorian
-     * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
-     * roll the hour value in the range between 0 and 23, which is zero-based.
+     * 02/29/96. Rolling by a positive value always means rolling forward in time (unless
+     * the limit of the field is reached, in which case it may pin or wrap), so for
+     * Gregorian calendar, starting with 100 BC and rolling the year by + 1 results in 99 BC.
+     * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+     * most eras in the Japanese calendar) then rolling the year past either limit of the
+     * era will cause the year to wrap around. When eras only have a limit at one end,
+     * then attempting to roll the year past that limit will result in pinning the year
+     * at that limit. Note that for most calendars in which era 0 years move forward in
+     * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+     * result in negative years for era 0 (that is the only way to represent years before
+     * the calendar epoch).
+     * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+     * hour value in the range between 0 and 23, which is zero-based.
      * <P>
      * The only difference between roll() and add() is that roll() does not change
      * the value of more significant fields when it reaches the minimum or maximum
@@ -620,10 +686,19 @@ public:
      * roll(Calendar::DATE, +1, status). When rolling on the month or
      * Calendar::MONTH field, other fields like date might conflict and, need to be
      * changed. For instance, rolling the month up on the date 01/31/96 will result in
-     * 02/29/96.  Rolling by a positive value always means rolling forward in time;
-     * e.g., rolling the year by +1 on "100 BC" will result in "99 BC", for Gregorian
-     * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
-     * roll the hour value in the range between 0 and 23, which is zero-based.
+     * 02/29/96. Rolling by a positive value always means rolling forward in time (unless
+     * the limit of the field is reached, in which case it may pin or wrap), so for
+     * Gregorian calendar, starting with 100 BC and rolling the year by + 1 results in 99 BC.
+     * When eras have a definite beginning and end (as in the Chinese calendar, or as in
+     * most eras in the Japanese calendar) then rolling the year past either limit of the
+     * era will cause the year to wrap around. When eras only have a limit at one end,
+     * then attempting to roll the year past that limit will result in pinning the year
+     * at that limit. Note that for most calendars in which era 0 years move forward in
+     * time (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to
+     * result in negative years for era 0 (that is the only way to represent years before
+     * the calendar epoch).
+     * When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the
+     * hour value in the range between 0 and 23, which is zero-based.
      * <P>
      * The only difference between roll() and add() is that roll() does not change
      * the value of more significant fields when it reaches the minimum or maximum
@@ -824,12 +899,82 @@ public:
     UBool isLenient(void) const;
 
     /**
+     * Sets the behavior for handling wall time repeating multiple times
+     * at negative time zone offset transitions. For example, 1:30 AM on
+     * November 6, 2011 in US Eastern time (Ameirca/New_York) occurs twice;
+     * 1:30 AM EDT, then 1:30 AM EST one hour later. When <code>UCAL_WALLTIME_FIRST</code>
+     * is used, the wall time 1:30AM in this example will be interpreted as 1:30 AM EDT
+     * (first occurrence). When <code>UCAL_WALLTIME_LAST</code> is used, it will be
+     * interpreted as 1:30 AM EST (last occurrence). The default value is
+     * <code>UCAL_WALLTIME_LAST</code>.
+     * <p>
+     * <b>Note:</b>When <code>UCAL_WALLTIME_NEXT_VALID</code> is not a valid
+     * option for this. When the argument is neither <code>UCAL_WALLTIME_FIRST</code>
+     * nor <code>UCAL_WALLTIME_LAST</code>, this method has no effect and will keep
+     * the current setting.
+     * 
+     * @param option the behavior for handling repeating wall time, either
+     * <code>UCAL_WALLTIME_FIRST</code> or <code>UCAL_WALLTIME_LAST</code>.
+     * @see #getRepeatedWallTimeOption
+     * @stable ICU 49
+     */
+    void setRepeatedWallTimeOption(UCalendarWallTimeOption option);
+
+    /**
+     * Gets the behavior for handling wall time repeating multiple times
+     * at negative time zone offset transitions.
+     * 
+     * @return the behavior for handling repeating wall time, either
+     * <code>UCAL_WALLTIME_FIRST</code> or <code>UCAL_WALLTIME_LAST</code>.
+     * @see #setRepeatedWallTimeOption
+     * @stable ICU 49
+     */
+    UCalendarWallTimeOption getRepeatedWallTimeOption(void) const;
+
+    /**
+     * Sets the behavior for handling skipped wall time at positive time zone offset
+     * transitions. For example, 2:30 AM on March 13, 2011 in US Eastern time (America/New_York)
+     * does not exist because the wall time jump from 1:59 AM EST to 3:00 AM EDT. When
+     * <code>UCAL_WALLTIME_FIRST</code> is used, 2:30 AM is interpreted as 30 minutes before 3:00 AM
+     * EDT, therefore, it will be resolved as 1:30 AM EST. When <code>UCAL_WALLTIME_LAST</code>
+     * is used, 2:30 AM is interpreted as 31 minutes after 1:59 AM EST, therefore, it will be
+     * resolved as 3:30 AM EDT. When <code>UCAL_WALLTIME_NEXT_VALID</code> is used, 2:30 AM will
+     * be resolved as next valid wall time, that is 3:00 AM EDT. The default value is
+     * <code>UCAL_WALLTIME_LAST</code>.
+     * <p>
+     * <b>Note:</b>This option is effective only when this calendar is lenient.
+     * When the calendar is strict, such non-existing wall time will cause an error.
+     * 
+     * @param option the behavior for handling skipped wall time at positive time zone
+     * offset transitions, one of <code>UCAL_WALLTIME_FIRST</code>, <code>UCAL_WALLTIME_LAST</code> and
+     * <code>UCAL_WALLTIME_NEXT_VALID</code>.
+     * @see #getSkippedWallTimeOption
+     * 
+     * @stable ICU 49
+     */
+    void setSkippedWallTimeOption(UCalendarWallTimeOption option);
+
+    /**
+     * Gets the behavior for handling skipped wall time at positive time zone offset
+     * transitions.
+     * 
+     * @return the behavior for handling skipped wall time, one of
+     * <code>UCAL_WALLTIME_FIRST</code>, <code>UCAL_WALLTIME_LAST</code>
+     * and <code>UCAL_WALLTIME_NEXT_VALID</code>.
+     * @see #setSkippedWallTimeOption
+     * @stable ICU 49
+     */
+    UCalendarWallTimeOption getSkippedWallTimeOption(void) const;
+
+#ifndef U_HIDE_DEPRECATED_API
+    /**
      * Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
      *
      * @param value  The given first day of the week.
      * @deprecated ICU 2.6. Use setFirstDayOfWeek(UCalendarDaysOfWeek value) instead.
      */
     void setFirstDayOfWeek(EDaysOfWeek value);
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
@@ -839,6 +984,7 @@ public:
      */
     void setFirstDayOfWeek(UCalendarDaysOfWeek value);
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
      *
@@ -846,6 +992,7 @@ public:
      * @deprecated ICU 2.6 use the overload with error code
      */
     EDaysOfWeek getFirstDayOfWeek(void) const;
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
@@ -958,6 +1105,7 @@ public:
      */
     virtual int32_t getLeastMaximum(UCalendarDateFields field) const;
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Return the minimum value that this field could have, given the current date.
      * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
@@ -973,6 +1121,7 @@ public:
      * @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field, UErrorCode& status) instead.
      */
     int32_t getActualMinimum(EDateFields field, UErrorCode& status) const;
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Return the minimum value that this field could have, given the current date.
@@ -990,6 +1139,7 @@ public:
      */
     virtual int32_t getActualMinimum(UCalendarDateFields field, UErrorCode& status) const;
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Return the maximum value that this field could have, given the current date.
      * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual
@@ -1007,6 +1157,7 @@ public:
      * @deprecated ICU 2.6. Use getActualMaximum(UCalendarDateFields field, UErrorCode& status) instead.
      */
     int32_t getActualMaximum(EDateFields field, UErrorCode& status) const;
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Return the maximum value that this field could have, given the current date.
@@ -1026,6 +1177,7 @@ public:
      */
     virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const;
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Gets the value for a given time field. Recalculate the current time field values
      * if the time value has been changed by a call to setTime(). Return zero for unset
@@ -1040,6 +1192,7 @@ public:
      * @deprecated ICU 2.6. Use get(UCalendarDateFields field, UErrorCode& status) instead.
      */
     int32_t get(EDateFields field, UErrorCode& status) const;
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Gets the value for a given time field. Recalculate the current time field values
@@ -1056,6 +1209,7 @@ public:
      */
     int32_t get(UCalendarDateFields field, UErrorCode& status) const;
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Determines if the given time field has a value set. This can affect in the
      * resolving of time in Calendar. Unset fields have a value of zero, by definition.
@@ -1065,6 +1219,7 @@ public:
      * @deprecated ICU 2.6. Use isSet(UCalendarDateFields field) instead.
      */
     UBool isSet(EDateFields field) const;
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Determines if the given time field has a value set. This can affect in the
@@ -1076,6 +1231,7 @@ public:
      */
     UBool isSet(UCalendarDateFields field) const;
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Sets the given time field with the given value.
      *
@@ -1084,6 +1240,7 @@ public:
      * @deprecated ICU 2.6. Use set(UCalendarDateFields field, int32_t value) instead.
      */
     void set(EDateFields field, int32_t value);
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Sets the given time field with the given value.
@@ -1143,6 +1300,7 @@ public:
      */
     void clear(void);
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Clears the value in the given time field, both making it unset and assigning it a
      * value of zero. This field value will be determined during the next resolving of
@@ -1152,6 +1310,7 @@ public:
      * @deprecated ICU 2.6. Use clear(UCalendarDateFields field) instead.
      */
     void clear(EDateFields field);
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Clears the value in the given time field, both making it unset and assigning it a
@@ -1181,19 +1340,44 @@ public:
     virtual UClassID getDynamicClassID(void) const = 0;
 
     /**
-     * Returns the resource key string used for this calendar type.
-     * For example, prepending "Eras_" to this string could return "Eras_japanese"
-     * or "Eras_gregorian".
-     *
-     * @returns static string, for example, "gregorian" or "japanese"
-     * @internal
+     * 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
+     *
+     * Sample code for getting the LDML/BCP 47 calendar key value:
+     * \code
+     * const char *calType = cal->getType();
+     * if (0 == strcmp(calType, "unknown")) {
+     *     // deal with unknown calendar type
+     * } else {
+     *     string localeID("root@calendar=");
+     *     localeID.append(calType);
+     *     char langTag[100];
+     *     UErrorCode errorCode = U_ZERO_ERROR;
+     *     int32_t length = uloc_toLanguageTag(localeID.c_str(), langTag, (int32_t)sizeof(langTag), TRUE, &errorCode);
+     *     if (U_FAILURE(errorCode)) {
+     *         // deal with errors & overflow
+     *     }
+     *     string lang(langTag, length);
+     *     size_t caPos = lang.find("-ca-");
+     *     lang.erase(0, caPos + 4);
+     *     // lang now contains the LDML calendar type
+     * }
+     * \endcode
+     *
+     * @return legacy calendar type name string
+     * @stable ICU 49
      */
     virtual const char * getType() const = 0;
 
     /**
-     * Returns whether the given day of the week is a weekday, a
-     * weekend day, or a day that transitions from one to the other,
-     * in this calendar system. If a transition occurs at midnight,
+     * Returns whether the given day of the week is a weekday, a weekend day,
+     * or a day that transitions from one to the other, for the locale and
+     * calendar system associated with this Calendar (the locale's region is
+     * often the most determinant factor). If a transition occurs at midnight,
      * then the days before and after the transition will have the
      * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time
      * other than midnight, then the day of the transition will have
@@ -1209,7 +1393,7 @@ public:
 
     /**
      * Returns the time during the day at which the weekend begins or ends in
-     * this calendar system.  If getDayOfWeekType() rerturns UCAL_WEEKEND_ONSET
+     * this calendar system.  If getDayOfWeekType() returns UCAL_WEEKEND_ONSET
      * for the specified dayOfWeek, return the time at which the weekend begins.
      * If getDayOfWeekType() returns UCAL_WEEKEND_CEASE for the specified dayOfWeek,
      * return the time at which the weekend ends. If getDayOfWeekType() returns
@@ -1349,6 +1533,7 @@ protected:
      */
     void complete(UErrorCode& status);
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Gets the value for a given time field. Subclasses can use this function to get
      * field values without forcing recomputation of time.
@@ -1358,7 +1543,9 @@ protected:
      * @deprecated ICU 2.6. Use internalGet(UCalendarDateFields field) instead.
      */
     inline int32_t internalGet(EDateFields field) const {return fFields[field];}
+#endif  /* U_HIDE_DEPRECATED_API */
 
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Gets the value for a given time field. Subclasses can use this function to get
      * field values without forcing recomputation of time. If the field's stamp is UNSET,
@@ -1380,7 +1567,9 @@ protected:
      * @internal
      */
     inline int32_t internalGet(UCalendarDateFields field) const {return fFields[field];}
+#endif  /* U_HIDE_INTERNAL_API */
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
      * Sets the value for a given time field.  This is a fast internal method for
      * subclasses.  It does not affect the areFieldsInSync, isTimeSet, or areAllFieldsSet
@@ -1391,6 +1580,7 @@ protected:
      * @deprecated ICU 2.6. Use internalSet(UCalendarDateFields field, int32_t value) instead.
      */
     void internalSet(EDateFields field, int32_t value);
+#endif  /* U_HIDE_DEPRECATED_API */
 
     /**
      * Sets the value for a given time field.  This is a fast internal method for
@@ -1416,11 +1606,13 @@ protected:
      * @internal
      */
     enum ELimitType {
+#ifndef U_HIDE_INTERNAL_API
       UCAL_LIMIT_MINIMUM = 0,
       UCAL_LIMIT_GREATEST_MINIMUM,
       UCAL_LIMIT_LEAST_MAXIMUM,
       UCAL_LIMIT_MAXIMUM,
       UCAL_LIMIT_COUNT
+#endif  /* U_HIDE_INTERNAL_API */
     };
 
     /**
@@ -1516,11 +1708,12 @@ protected:
      * (YEAR_WOY and WEEK_OF_YEAR) to an extended year in the case
      * where YEAR, EXTENDED_YEAR are not set.
      * The Calendar implementation assumes yearWoy is in extended gregorian form
-     * @internal
      * @return the extended year, UCAL_EXTENDED_YEAR
+     * @internal
      */
     virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
 
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Compute the Julian day from fields.  Will determine whether to use
      * the JULIAN_DAY field directly, or other fields.
@@ -1621,6 +1814,7 @@ protected:
      * @internal
      */
     UCalendarDateFields resolveFields(const UFieldResolutionTable *precedenceTable);
+#endif  /* U_HIDE_INTERNAL_API */
 
 
     /**
@@ -1628,12 +1822,14 @@ protected:
      */
     virtual const UFieldResolutionTable* getFieldResolutionTable() const;
 
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Return the field that is newer, either defaultField, or
      * alternateField.  If neither is newer or neither is set, return defaultField.
      * @internal
      */
     UCalendarDateFields newerField(UCalendarDateFields defaultField, UCalendarDateFields alternateField) const;
+#endif  /* U_HIDE_INTERNAL_API */
 
 
 private:
@@ -1755,6 +1951,7 @@ protected:
      */
     virtual void handleComputeFields(int32_t julianDay, UErrorCode &status);
 
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Return the extended year on the Gregorian calendar as computed by
      * <code>computeGregorianFields()</code>.
@@ -1790,6 +1987,7 @@ protected:
     int32_t getGregorianDayOfMonth() const {
       return fGregorianDayOfMonth;
     }
+#endif  /* U_HIDE_INTERNAL_API */
 
     /**
      * Called by computeJulianDay.  Returns the default month (0-based) for the year,
@@ -1891,6 +2089,7 @@ protected:
     int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
 
 
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Return the week number of a day, within a period. This may be the week number in
      * a year, or the week number in a month. Usually this will be a value >= 1, but if
@@ -1928,6 +2127,7 @@ protected:
      * @internal
      */
     int32_t getLocalDOW();
+#endif  /* U_HIDE_INTERNAL_API */
 
 private:
 
@@ -1937,6 +2137,12 @@ private:
     int32_t fNextStamp;// = MINIMUM_USER_STAMP;
 
     /**
+     * Recalculates the time stamp array (fStamp).
+     * Resets fNextStamp to lowest next stamp value.
+     */
+    void recalculateStamp();
+
+    /**
      * The current time set for the calendar.
      */
     UDate        fTime;
@@ -1953,6 +2159,18 @@ private:
     TimeZone*   fZone;
 
     /**
+     * Option for rpeated wall time
+     * @see #setRepeatedWallTimeOption
+     */
+    UCalendarWallTimeOption fRepeatedWallTime;
+
+    /**
+     * Option for skipped wall time
+     * @see #setSkippedWallTimeOption
+     */
+    UCalendarWallTimeOption fSkippedWallTime;
+
+    /**
      * Both firstDayOfWeek and minimalDaysInFirstWeek are locale-dependent. They are
      * used to figure out the week count for a specific date for a given locale. These
      * must be set when a Calendar is constructed. For example, in US locale,
@@ -2078,7 +2296,7 @@ private:
      * Validate a single field of this calendar.  Subclasses should
      * override this method to validate any calendar-specific fields.
      * Generic fields can be handled by
-     * <code>Calendar.validateField()</code>.
+     * <code>Calendar::validateField()</code>.
      * @see #validateField(int, int, int, int&)
      * @internal
      */
@@ -2095,6 +2313,7 @@ private:
     void validateField(UCalendarDateFields field, int32_t min, int32_t max, UErrorCode& status);
 
  protected:
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Convert a quasi Julian date to the day of the week. The Julian date used here is
      * not a true Julian date, since it is measured from midnight, not noon. Return
@@ -2105,6 +2324,7 @@ private:
      * @internal
      */
     static uint8_t julianDayToDayOfWeek(double julian);
+#endif  /* U_HIDE_INTERNAL_API */
 
  private:
     char validLocale[ULOC_FULLNAME_CAPACITY];
@@ -2116,6 +2336,7 @@ private:
      * INTERNAL FOR 2.6 --  Registration.
      */
 
+#ifndef U_HIDE_INTERNAL_API
     /**
      * Return a StringEnumeration over the locales available at the time of the call,
      * including registered locales.
@@ -2145,6 +2366,7 @@ private:
      * @internal
      */
     static UBool unregister(URegistryKey key, UErrorCode& status);
+#endif  /* U_HIDE_INTERNAL_API */
 
     /**
      * Multiple Calendar Implementation
@@ -2166,19 +2388,19 @@ private:
 #endif /* !UCONFIG_NO_SERVICE */
 
     /**
-     * @internal
      * @return TRUE if this calendar has a default century (i.e. 03 -> 2003)
+     * @internal
      */
     virtual UBool haveDefaultCentury() const = 0;
 
     /**
-     * @internal
      * @return the start of the default century, as a UDate
+     * @internal
      */
     virtual UDate defaultCenturyStart() const = 0;
     /**
-     * @internal
      * @return the beginning year of the default century, as a year
+     * @internal
      */
     virtual int32_t defaultCenturyStartYear() const = 0;
 
@@ -2190,6 +2412,7 @@ private:
      */
     Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const;
 
+#ifndef U_HIDE_INTERNAL_API
     /** Get the locale for this calendar object. You can choose between valid and actual locale.
      *  @param type type of the locale we're looking for (valid or actual)
      *  @param status error code for the operation
@@ -2197,7 +2420,14 @@ private:
      *  @internal
      */
     const char* getLocaleID(ULocDataLocaleType type, UErrorCode &status) const;
+#endif  /* U_HIDE_INTERNAL_API */
 
+private:
+    /**
+     * Cast TimeZone used by this object to BasicTimeZone, or NULL if the TimeZone
+     * is not an instance of BasicTimeZone.
+     */
+    BasicTimeZone* getBasicTimeZone() const;
 };
 
 // -------------------------------------
@@ -2217,11 +2447,13 @@ Calendar::roll(UCalendarDateFields field, UBool up, UErrorCode& status)
     roll(field, (int32_t)(up ? +1 : -1), status);
 }
 
+#ifndef U_HIDE_DEPRECATED_API
 inline void
 Calendar::roll(EDateFields field, UBool up, UErrorCode& status)
 {
     roll((UCalendarDateFields) field, up, status);
 }
+#endif
 
 
 // -------------------------------------
@@ -2239,11 +2471,13 @@ Calendar::internalSet(UCalendarDateFields field, int32_t value)
     fIsSet[field]     = TRUE; // Remove later
 }
 
+
+#ifndef U_HIDE_INTERNAL_API
 inline int32_t  Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek)
 {
   return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);
 }
-
+#endif
 
 U_NAMESPACE_END