Class CECalendar
java.lang.Object
com.ibm.icu.util.Calendar
com.ibm.icu.util.CECalendar
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<Calendar>
- Direct Known Subclasses:
CopticCalendar, EthiopicCalendar
Base class for EthiopicCalendar and CopticCalendar.
-
Nested Class Summary
Nested classes/interfaces inherited from class Calendar
Calendar.FormatConfiguration, Calendar.PatternData, Calendar.WeekData -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[][]private static final longFields inherited from class Calendar
AM, AM_PM, APRIL, AUGUST, BASE_FIELD_COUNT, DATE, DATE_PRECEDENCE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DOW_LOCAL, DOW_PRECEDENCE, 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, MONTH_PRECEDENCE, 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
ConstructorsModifierConstructorDescriptionprotectedConstructs a defaultCECalendarusing the current time in the default time zone with the defaultFORMATlocale.protectedCECalendar(int year, int month, int date) Constructs aCECalendarwith the given date set in the default time zone with the defaultFORMATlocale.protectedCECalendar(int year, int month, int date, int hour, int minute, int second) Constructs aCECalendarwith the given date and time set for the default time zone with the defaultFORMATlocale.protectedCECalendar(TimeZone zone) Constructs aCECalendarbased on the current time in the given time zone with the defaultFORMATlocale.protectedCECalendar(TimeZone zone, ULocale locale) Constructs aCECalendarbased on the current time in the given time zone with the given locale.protectedCECalendar(TimeZone zone, Locale aLocale) Constructs aCECalendarbased on the current time in the given time zone with the given locale.protectedCECalendar(ULocale locale) Constructs aCECalendarbased on the current time in the default time zone with the given locale.protectedCECalendar(Date date) Constructs aCECalendarwith the given date set in the default time zone with the defaultFORMATlocale.protectedCECalendar(Locale aLocale) Constructs aCECalendarbased on the current time in the default time zone with the given locale. -
Method Summary
Modifier and TypeMethodDescriptionstatic intceToJD(long year, int month, int day, int jdEpochOffset) Convert an Coptic/Ethiopic year, month and day to a Julian dayprotected abstract intextendedYearToEra(int eyear) Deprecated.This API is ICU internal only.protected abstract intextendedYearToYear(int eyear) Deprecated.This API is ICU internal only.protected abstract intThe Coptic and Ethiopic calendars differ only in their epochs.Gets The Temporal monthCode value corresponding to the month for the date.protected voidhandleComputeFields(int julianDay) Deprecated.This API is ICU internal only.protected inthandleComputeMonthStart(int eyear, int emonth, boolean useMonth) Return JD of start of given month/extended yearprotected inthandleGetLimit(int field, int limitType) Calculate the limit for a specified type of limit and fieldprotected inthandleGetMonthLength(int extendedYear, int month) Return the number of days in the given month of the given extended year of this calendar system.static voidjdToCE(int julianDay, int jdEpochOffset, int[] fields) Convert a Julian day to an Coptic/Ethiopic year, month and dayvoidsetTemporalMonthCode(String temporalMonth) Sets The Temporal monthCode which is a string identifier that starts with the literal grapheme "M" followed by two graphemes representing the zero-padded month number of the current month in a normal (non-leap) year.Methods 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, getActualMaximum, getActualMinimum, 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, getRelatedYearDifference, getRepeatedWallTimeOption, getSkippedWallTimeOption, getStamp, getTime, getTimeInMillis, getTimeZone, getType, getWeekData, getWeekDataForRegion, getWeekendTransition, gregorianMonthLength, gregorianPreviousMonthLength, handleComputeJulianDay, handleCreateFields, handleGetDateFormat, handleGetDateFormat, handleGetDateFormat, handleGetDateFormat, handleGetExtendedYear, handleGetYearLength, hashCode, haveDefaultCentury, inTemporalLeapYear, internalGet, internalGet, internalGetMonth, internalGetMonth, internalGetTimeInMillis, internalSet, isEquivalentTo, isEra0CountingBackward, isGregorianLeapYear, isLenient, isSet, isWeekend, isWeekend, julianDayToDayOfWeek, julianDayToMillis, millisToJulianDay, newerField, newestStamp, pinField, prepareGetActual, resolveFields, roll, roll, set, set, set, set, setFirstDayOfWeek, setLenient, setLocale, setMinimalDaysInFirstWeek, setRelatedYear, setRepeatedWallTimeOption, setSkippedWallTimeOption, setTime, setTimeInMillis, setTimeZone, setWeekData, toString, validateField, validateField, validateFields, weekNumber, weekNumber
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
LIMITS
private static final int[][] LIMITS
-
-
Constructor Details
-
CECalendar
protected CECalendar()Constructs a defaultCECalendarusing the current time in the default time zone with the defaultFORMATlocale. -
CECalendar
Constructs aCECalendarbased on the current time in the given time zone with the defaultFORMATlocale.- Parameters:
zone- The time zone for the new calendar.
-
CECalendar
Constructs aCECalendarbased on the current time in the default time zone with the given locale.- Parameters:
aLocale- The locale for the new calendar.
-
CECalendar
Constructs aCECalendarbased on the current time in the default time zone with the given locale.- Parameters:
locale- The locale for the new calendar.
-
CECalendar
-
CECalendar
-
CECalendar
protected CECalendar(int year, int month, int date) Constructs aCECalendarwith the given date set in the default time zone with the defaultFORMATlocale. -
CECalendar
Constructs aCECalendarwith the given date set in the default time zone with the defaultFORMATlocale.- Parameters:
date- The date to which the new calendar is set.
-
CECalendar
protected CECalendar(int year, int month, int date, int hour, int minute, int second) Constructs aCECalendarwith the given date and time set for the default time zone with the defaultFORMATlocale.- 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 Tishri.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
-
getJDEpochOffset
protected abstract int getJDEpochOffset()The Coptic and Ethiopic calendars differ only in their epochs. This method must be implemented by CECalendar subclasses to return the date offset from Julian. -
handleComputeFields
Deprecated.This API is ICU internal only.Subclasses may override this method to compute several fields specific to each calendar system. These are:- ERA
- YEAR
- MONTH
- DAY_OF_MONTH
- DAY_OF_YEAR
- EXTENDED_YEAR
In addition, subclasses should compute any subclass-specific fields, that is, fields from BASE_FIELD_COUNT to getFieldCount() - 1.
The default implementation in
Calendarimplements a pure proleptic Gregorian calendar.- Overrides:
handleComputeFieldsin classCalendar
-
extendedYearToEra
Deprecated.This API is ICU internal only.Convert extended year to era -
extendedYearToYear
Deprecated.This API is ICU internal only.Convert extended year to year -
handleComputeMonthStart
protected int handleComputeMonthStart(int eyear, int emonth, boolean useMonth) Return JD of start of given month/extended year- Specified by:
handleComputeMonthStartin classCalendar- Parameters:
eyear- the extended yearemonth- the zero-based month, or 0 if useMonth is falseuseMonth- if false, compute the day before the first day of the given year, otherwise, compute the day before the first day of the given month- Returns:
- the Julian day number of the day before the first day of the given month and year
-
handleGetLimit
protected int handleGetLimit(int field, int limitType) Calculate the limit for a specified type of limit and field- Specified by:
handleGetLimitin classCalendar- Parameters:
field- one of the above field numberslimitType- one ofMINIMUM,GREATEST_MINIMUM,LEAST_MAXIMUM, orMAXIMUM
-
handleGetMonthLength
protected int handleGetMonthLength(int extendedYear, int month) Return the number of days in the given month of the given extended year of this calendar system. Subclasses should override this method if they can provide a more correct or more efficient implementation than the default implementation in Calendar.- Overrides:
handleGetMonthLengthin classCalendar
-
ceToJD
public static int ceToJD(long year, int month, int day, int jdEpochOffset) Convert an Coptic/Ethiopic year, month and day to a Julian day- Parameters:
year- the extended yearmonth- the monthday- the day- Returns:
- Julian day
-
jdToCE
public static void jdToCE(int julianDay, int jdEpochOffset, int[] fields) Convert a Julian day to an Coptic/Ethiopic year, month and day -
getTemporalMonthCode
Gets The Temporal monthCode value corresponding to the month for the date. The value is a string identifier that starts with the literal grapheme "M" followed by two graphemes representing the zero-padded month number of the current month in a normal (non-leap) year. For the short thirteen month in each year in the CECalendar, the value is "M13".- Overrides:
getTemporalMonthCodein classCalendar- Returns:
- One of 13 possible strings in {"M01".. "M12", "M13"}.
-
setTemporalMonthCode
Sets The Temporal monthCode which is a string identifier that starts with the literal grapheme "M" followed by two graphemes representing the zero-padded month number of the current month in a normal (non-leap) year. For CECalendar calendar, the values are "M01" .. "M13" while the "M13" is represent the short thirteen month in each year.- Overrides:
setTemporalMonthCodein classCalendar- Parameters:
temporalMonth- One of 13 possible strings in {"M01".. "M12", "M13"}.
-