Package org.joda.time.chrono
Class EthiopicChronology
- All Implemented Interfaces:
Serializable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.joda.time.chrono.AssembledChronology
AssembledChronology.Fields -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentHashMap<DateTimeZone, EthiopicChronology[]> Cache of zone to chronology arraysstatic final intConstant value for 'Ethiopean Era', equivalent to the value returned for AD/CE.private static final DateTimeFieldA singleton era field.private static final EthiopicChronologySingleton instance of a UTC EthiopicChronologyprivate static final intThe highest year that can be fully supported.private static final intThe lowest year that can be fully supported.private static final longSerialization lockFields inherited from class org.joda.time.chrono.BasicFixedMonthChronology
MILLIS_PER_MONTH, MILLIS_PER_YEAR, MONTH_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionEthiopicChronology(Chronology base, Object param, int minDaysInFirstWeek) Restricted constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassemble(AssembledChronology.Fields fields) Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields.(package private) longcalculateFirstDayOfYearMillis(int year) Gets the millisecond value of the first day of the year.(package private) longReturns a constant representing the approximate number of milliseconds elapsed from year 0 of this chronology, divided by two.static EthiopicChronologyGets an instance of the EthiopicChronology in the default time zone.static EthiopicChronologygetInstance(DateTimeZone zone) Gets an instance of the EthiopicChronology in the given time zone.static EthiopicChronologygetInstance(DateTimeZone zone, int minDaysInFirstWeek) Gets an instance of the EthiopicChronology in the given time zone.static EthiopicChronologyGets an instance of the EthiopicChronology.(package private) intGets the maximum supported year.(package private) intGets the minimum supported year.(package private) booleanisLeapDay(long instant) Is the specified instant a leap day?private ObjectSerialization singleton.withUTC()Gets the Chronology in the UTC time zone.withZone(DateTimeZone zone) Gets the Chronology in a specific time zone.Methods inherited from class org.joda.time.chrono.BasicFixedMonthChronology
getAverageMillisPerMonth, getAverageMillisPerYear, getAverageMillisPerYearDividedByTwo, getDayOfMonth, getDaysInMonthMax, getDaysInMonthMax, getDaysInYearMonth, getMaxMonth, getMonthOfYear, getMonthOfYear, getTotalMillisByYearMonth, getYearDifference, isLeapYear, setYearMethods inherited from class org.joda.time.chrono.BasicChronology
equals, getDateMidnightMillis, getDateTimeMillis, getDateTimeMillis, getDayOfMonth, getDayOfMonth, getDayOfWeek, getDayOfYear, getDayOfYear, getDaysInMonthMax, getDaysInMonthMaxForSet, getDaysInYear, getDaysInYearMax, getFirstWeekOfYearMillis, getMaxMonth, getMillisOfDay, getMinimumDaysInFirstWeek, getWeekOfWeekyear, getWeekOfWeekyear, getWeeksInYear, getWeekyear, getYear, getYearMillis, getYearMonthDayMillis, getYearMonthMillis, getZone, hashCode, toStringMethods inherited from class org.joda.time.chrono.AssembledChronology
centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, getBase, getDateTimeMillis, getParam, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, year, yearOfCentury, yearOfEra, years
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization lock- See Also:
-
EE
public static final int EEConstant value for 'Ethiopean Era', equivalent to the value returned for AD/CE.- See Also:
-
ERA_FIELD
A singleton era field. -
MIN_YEAR
private static final int MIN_YEARThe lowest year that can be fully supported.- See Also:
-
MAX_YEAR
private static final int MAX_YEARThe highest year that can be fully supported.- See Also:
-
cCache
Cache of zone to chronology arrays -
INSTANCE_UTC
Singleton instance of a UTC EthiopicChronology
-
-
Constructor Details
-
EthiopicChronology
EthiopicChronology(Chronology base, Object param, int minDaysInFirstWeek) Restricted constructor.
-
-
Method Details
-
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
Gets an instance of the EthiopicChronology in the default time zone.- Returns:
- a chronology in the default time zone
-
getInstance
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
Gets an instance of the EthiopicChronology in the given time zone.- Parameters:
zone- the time zone to get the chronology in, null is defaultminDaysInFirstWeek- minimum number of days in first week of the year; default is 4- Returns:
- a chronology in the specified time zone
-
readResolve
Serialization singleton. -
withUTC
Gets the Chronology in the UTC time zone.- Specified by:
withUTCin classBaseChronology- Returns:
- the chronology in UTC
-
withZone
Gets the Chronology in a specific time zone.- Specified by:
withZonein classBaseChronology- Parameters:
zone- the zone to get the chronology in, null is default- Returns:
- the chronology
- See Also:
-
isLeapDay
boolean isLeapDay(long instant) Description copied from class:BasicChronologyIs the specified instant a leap day?- Overrides:
isLeapDayin classBasicChronology- Parameters:
instant- the instant to test- Returns:
- true if leap, default is false
-
calculateFirstDayOfYearMillis
long calculateFirstDayOfYearMillis(int year) Description copied from class:BasicChronologyGets the millisecond value of the first day of the year.- Specified by:
calculateFirstDayOfYearMillisin classBasicChronology- Returns:
- the milliseconds for the first of the year
-
getMinYear
int getMinYear()Description copied from class:BasicChronologyGets the minimum supported year.- Specified by:
getMinYearin classBasicChronology- Returns:
- the year
-
getMaxYear
int getMaxYear()Description copied from class:BasicChronologyGets the maximum supported year.- Specified by:
getMaxYearin classBasicChronology- Returns:
- the year
-
getApproxMillisAtEpochDividedByTwo
long getApproxMillisAtEpochDividedByTwo()Description copied from class:BasicChronologyReturns 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) / 2where epoch is 1970-01-01 (Gregorian).- Specified by:
getApproxMillisAtEpochDividedByTwoin classBasicChronology
-
assemble
Description copied from class:AssembledChronologyInvoked by the constructor and after deserialization to allow subclasses to define all of its supported fields. All unset fields default to unsupported instances.- Overrides:
assemblein classBasicChronology- Parameters:
fields- container of fields
-