Class CECalendar

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Calendar>
    Direct Known Subclasses:
    CopticCalendar, EthiopicCalendar

    abstract class CECalendar
    extends Calendar
    Base class for EthiopicCalendar and CopticCalendar.
    • Field Detail

      • LIMITS

        private static final int[][] LIMITS
    • Constructor Detail

      • CECalendar

        protected CECalendar()
        Constructs a default CECalendar using the current time in the default time zone with the default FORMAT locale.
      • CECalendar

        protected CECalendar​(TimeZone zone)
        Constructs a CECalendar based on the current time in the given time zone with the default FORMAT locale.
        Parameters:
        zone - The time zone for the new calendar.
      • CECalendar

        protected CECalendar​(java.util.Locale aLocale)
        Constructs a CECalendar based on the current time in the default time zone with the given locale.
        Parameters:
        aLocale - The locale for the new calendar.
      • CECalendar

        protected CECalendar​(ULocale locale)
        Constructs a CECalendar based on the current time in the default time zone with the given locale.
        Parameters:
        locale - The locale for the new calendar.
      • CECalendar

        protected CECalendar​(TimeZone zone,
                             java.util.Locale aLocale)
        Constructs a CECalendar based on the current time in the given time zone with the given locale.
        Parameters:
        zone - The time zone for the new calendar.
        aLocale - The locale for the new calendar.
      • CECalendar

        protected CECalendar​(TimeZone zone,
                             ULocale locale)
        Constructs a CECalendar based on the current time in the given time zone with the given locale.
        Parameters:
        zone - The time zone for the new calendar.
        locale - The locale for the new calendar.
      • CECalendar

        protected CECalendar​(int year,
                             int month,
                             int date)
        Constructs a CECalendar with the given date set in the default time zone with the default FORMAT 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 Tishri.
        date - The value used to set the calendar's DATE time field.
      • CECalendar

        protected CECalendar​(java.util.Date date)
        Constructs a CECalendar with the given date set in the default time zone with the default FORMAT locale.
        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 a CECalendar with the given date and time set for the default time zone with the default FORMAT 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 Tishri.
        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.
    • Method Detail

      • 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.
      • handleComputeMonthStart

        protected int handleComputeMonthStart​(int eyear,
                                              int emonth,
                                              boolean useMonth)
        Return JD of start of given month/extended year
        Specified by:
        handleComputeMonthStart in class Calendar
        Parameters:
        eyear - the extended year
        emonth - the zero-based month, or 0 if useMonth is false
        useMonth - 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:
        handleGetLimit in class Calendar
        Parameters:
        field - one of the above field numbers
        limitType - one of MINIMUM, GREATEST_MINIMUM, LEAST_MAXIMUM, or MAXIMUM
      • 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:
        handleGetMonthLength in class Calendar
      • 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 year
        month - the month
        day - 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

        public java.lang.String 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:
        getTemporalMonthCode in class Calendar
        Returns:
        One of 13 possible strings in {"M01".. "M12", "M13"}.
      • setTemporalMonthCode

        public void setTemporalMonthCode​(java.lang.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. For CECalendar calendar, the values are "M01" .. "M13" while the "M13" is represent the short thirteen month in each year.
        Overrides:
        setTemporalMonthCode in class Calendar
        Parameters:
        temporalMonth - One of 13 possible strings in {"M01".. "M12", "M13"}.