Class CopticChronology
- java.lang.Object
-
- javax.time.calendar.Chronology
-
- javax.time.i18n.CopticChronology
-
- All Implemented Interfaces:
java.io.Serializable
,Calendrical
public final class CopticChronology extends Chronology implements java.io.Serializable
The Coptic calendar system.CopticChronology defines the rules of the Coptic calendar system. The Coptic calendar has twelve months of 30 days followed by an additional period of 5 or 6 days, modelled as the thirteenth month in this implementation.
Years are measured in the 'Era of the Martyrs'. 0001-01-01 (Coptic) equals 0284-08-29 (ISO). The supported range is from Coptic year 1 to year 9999 (inclusive).
CopticChronology is immutable and thread-safe.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CopticChronology.DayOfMonthRule
Rule implementation.private static class
CopticChronology.DayOfWeekRule
Rule implementation.private static class
CopticChronology.DayOfYearRule
Rule implementation.private static class
CopticChronology.MonthOfYearRule
Rule implementation.private static class
CopticChronology.Months
Unit class for months.private static class
CopticChronology.YearRule
Rule implementation.private static class
CopticChronology.Years
Unit class for years.
-
Field Summary
Fields Modifier and Type Field Description static CopticChronology
INSTANCE
The singleton instance ofCopticChronology
.private static PeriodUnit
MONTHS
Period unit for months.private static long
serialVersionUID
A serialization identifier for this class.private static PeriodUnit
YEARS
Period unit for years.
-
Constructor Summary
Constructors Modifier Constructor Description private
CopticChronology()
Restrictive constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DateTimeFieldRule<java.lang.Integer>
dayOfMonthRule()
Gets the rule for the day-of-month field in the Coptic chronology.static DateTimeFieldRule<DayOfWeek>
dayOfWeekRule()
Gets the rule for the day-of-week field in the Coptic chronology.static DateTimeFieldRule<java.lang.Integer>
dayOfYearRule()
Gets the rule for the day-of-year field in the Coptic chronology.java.lang.String
getName()
Gets the name of the chronology.static boolean
isLeapYear(int year)
Checks if the specified year is a leap year.static DateTimeFieldRule<java.lang.Integer>
monthOfYearRule()
Gets the rule for the month-of-year field in the Coptic chronology.static PeriodUnit
periodDays()
Gets the period unit for days.static PeriodUnit
periodMonths()
Gets the period unit for months.static PeriodUnit
periodWeeks()
Gets the period unit for weeks.static PeriodUnit
periodYears()
Gets the period unit for years.private java.lang.Object
readResolve()
Resolves singleton.static DateTimeFieldRule<java.lang.Integer>
yearRule()
Gets the rule for the year field in the Coptic chronology.-
Methods inherited from class javax.time.calendar.Chronology
get, rule, toString
-
-
-
-
Field Detail
-
INSTANCE
public static final CopticChronology INSTANCE
The singleton instance ofCopticChronology
.
-
serialVersionUID
private static final long serialVersionUID
A serialization identifier for this class.- See Also:
- Constant Field Values
-
YEARS
private static final PeriodUnit YEARS
Period unit for years.
-
MONTHS
private static final PeriodUnit MONTHS
Period unit for months.
-
-
Method Detail
-
readResolve
private java.lang.Object readResolve()
Resolves singleton.- Returns:
- the singleton instance
-
isLeapYear
public static boolean isLeapYear(int year)
Checks if the specified year is a leap year.A year is leap if the remainder after division by four equals three. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.
- Parameters:
year
- the year to check, not validated for range- Returns:
- true if the year is a leap year
-
getName
public java.lang.String getName()
Gets the name of the chronology.- Specified by:
getName
in classChronology
- Returns:
- the name of the chronology, never null
-
yearRule
public static DateTimeFieldRule<java.lang.Integer> yearRule()
Gets the rule for the year field in the Coptic chronology.- Returns:
- the rule for the year field, never null
-
monthOfYearRule
public static DateTimeFieldRule<java.lang.Integer> monthOfYearRule()
Gets the rule for the month-of-year field in the Coptic chronology.- Returns:
- the rule for the month-of-year field, never null
-
dayOfMonthRule
public static DateTimeFieldRule<java.lang.Integer> dayOfMonthRule()
Gets the rule for the day-of-month field in the Coptic chronology.- Returns:
- the rule for the day-of-month field, never null
-
dayOfYearRule
public static DateTimeFieldRule<java.lang.Integer> dayOfYearRule()
Gets the rule for the day-of-year field in the Coptic chronology.- Returns:
- the rule for the day-of-year field, never null
-
dayOfWeekRule
public static DateTimeFieldRule<DayOfWeek> dayOfWeekRule()
Gets the rule for the day-of-week field in the Coptic chronology.- Returns:
- the rule for the day-of-week field, never null
-
periodYears
public static PeriodUnit periodYears()
Gets the period unit for years.The period unit defines the concept of a period of a year. This has an estimated duration equal to 365.25 days.
See
yearRule()
for the main date-time field.- Returns:
- the period unit for years, never null
-
periodMonths
public static PeriodUnit periodMonths()
Gets the period unit for months.The period unit defines the concept of a period of a month. Coptic months are typically 30 days long, except for the 13th month which is 5 or 6 days long. The rule uses an estimated duration of 29.5 days.
See
monthOfYearRule()
for the main date-time field.- Returns:
- the period unit for months, never null
-
periodWeeks
public static PeriodUnit periodWeeks()
Gets the period unit for weeks.The period unit defines the concept of a period of a week. This is equivalent to the ISO weeks period unit.
- Returns:
- the period unit for weeks, never null
-
periodDays
public static PeriodUnit periodDays()
Gets the period unit for days.The period unit defines the concept of a period of a day. This is equivalent to the ISO days period unit.
See
dayOfMonthRule()
for the main date-time field.- Returns:
- the period unit for days, never null
-
-