Class EthiopicChronology

  • All Implemented Interfaces:
    java.io.Serializable

    public final class EthiopicChronology
    extends BasicFixedMonthChronology
    Implements the Ethiopic calendar system, which defines every fourth year as leap, much like the Julian calendar. The year is broken down into 12 months, each 30 days in length. An extra period at the end of the year is either 5 or 6 days in length. In this implementation, it is considered a 13th month.

    Year 1 in the Ethiopic calendar began on August 29, 8 CE (Julian), thus Ethiopic years do not begin at the same time as Julian years. This chronology is not proleptic, as it does not allow dates before the first Ethiopic year.

    This implementation defines a day as midnight to midnight exactly as per the ISO chronology. Some references indicate that a coptic day starts at sunset on the previous ISO day, but this has not been confirmed and is not implemented.

    EthiopicChronology is thread-safe and immutable.

    Since:
    1.2
    See Also:
    Wikipedia, Serialized Form
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Serialization lock
        See Also:
        Constant Field Values
      • EE

        public static final int EE
        Constant value for 'Ethiopean Era', equivalent to the value returned for AD/CE.
        See Also:
        Constant Field Values
      • ERA_FIELD

        private static final DateTimeField ERA_FIELD
        A singleton era field.
      • MIN_YEAR

        private static final int MIN_YEAR
        The lowest year that can be fully supported.
        See Also:
        Constant Field Values
      • MAX_YEAR

        private static final int MAX_YEAR
        The highest year that can be fully supported.
        See Also:
        Constant Field Values
      • INSTANCE_UTC

        private static final EthiopicChronology INSTANCE_UTC
        Singleton instance of a UTC EthiopicChronology
    • Constructor Detail

      • EthiopicChronology

        EthiopicChronology​(Chronology base,
                           java.lang.Object param,
                           int minDaysInFirstWeek)
        Restricted constructor.
    • Method Detail

      • getInstanceUTC

        public static EthiopicChronology getInstanceUTC()
        Gets an instance of the EthiopicChronology. The time zone of the returned instance is UTC.
        Returns:
        a singleton UTC instance of the chronology
      • getInstance

        public static EthiopicChronology getInstance()
        Gets an instance of the EthiopicChronology in the default time zone.
        Returns:
        a chronology in the default time zone
      • getInstance

        public static EthiopicChronology getInstance​(DateTimeZone zone)
        Gets an instance of the EthiopicChronology in the given time zone.
        Parameters:
        zone - the time zone to get the chronology in, null is default
        Returns:
        a chronology in the specified time zone
      • getInstance

        public static EthiopicChronology getInstance​(DateTimeZone zone,
                                                     int minDaysInFirstWeek)
        Gets an instance of the EthiopicChronology in the given time zone.
        Parameters:
        zone - the time zone to get the chronology in, null is default
        minDaysInFirstWeek - minimum number of days in first week of the year; default is 4
        Returns:
        a chronology in the specified time zone
      • readResolve

        private java.lang.Object readResolve()
        Serialization singleton.
      • withUTC

        public Chronology withUTC()
        Gets the Chronology in the UTC time zone.
        Specified by:
        withUTC in class BaseChronology
        Returns:
        the chronology in UTC
      • isLeapDay

        boolean isLeapDay​(long instant)
        Description copied from class: BasicChronology
        Is the specified instant a leap day?
        Overrides:
        isLeapDay in class BasicChronology
        Parameters:
        instant - the instant to test
        Returns:
        true if leap, default is false
      • calculateFirstDayOfYearMillis

        long calculateFirstDayOfYearMillis​(int year)
        Description copied from class: BasicChronology
        Gets the millisecond value of the first day of the year.
        Specified by:
        calculateFirstDayOfYearMillis in class BasicChronology
        Returns:
        the milliseconds for the first of the year
      • getApproxMillisAtEpochDividedByTwo

        long getApproxMillisAtEpochDividedByTwo()
        Description copied from class: BasicChronology
        Returns a constant representing the approximate number of milliseconds elapsed from year 0 of this chronology, divided by two. This constant must be defined as:
            (yearAtEpoch * averageMillisPerYear + millisOfYearAtEpoch) / 2
         
        where epoch is 1970-01-01 (Gregorian).
        Specified by:
        getApproxMillisAtEpochDividedByTwo in class BasicChronology
      • assemble

        protected void assemble​(AssembledChronology.Fields fields)
        Description copied from class: AssembledChronology
        Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields. All unset fields default to unsupported instances.
        Overrides:
        assemble in class BasicChronology
        Parameters:
        fields - container of fields