Class CopticCalendar
java.lang.Object
org.episteme.social.history.calendars.AlternateCalendar
org.episteme.social.history.calendars.SevenDaysWeek
org.episteme.social.history.calendars.MonthDayYear
org.episteme.social.history.calendars.GregorianCalendar
org.episteme.social.history.calendars.JulianCalendar
org.episteme.social.history.calendars.CopticCalendar
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EthiopicCalendar
Implementation of the Coptic calendar.
The Coptic calendar is used by the Coptic Orthodox Church and is
based on the ancient Egyptian calendar with leap year rules.
Key features:
- Epoch: August 29, 284 CE (Julian) - Era of Martyrs
- 13 months: 12 of 30 days + Nasie (5 or 6 days)
- Leap year every 4 years (without century exception)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic longThe RD number of the Coptic epoch (August 29, 284 CE Julian).Fields inherited from class MonthDayYear
day, month, yearFields inherited from class SevenDaysWeek
DAY_NAMES, FRIDAY, MONDAY, SATURDAY, SUNDAY, THURSDAY, TUESDAY, WEDNESDAYFields inherited from class AlternateCalendar
JD_EPOCH, rd, unicode -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new CopticCalendar object.CopticCalendar(int i, int j, int k) Creates a new CopticCalendar object.CopticCalendar(long l) Creates a new CopticCalendar object.CopticCalendar(AlternateCalendar altcalendar) Creates a new CopticCalendar object. -
Method Summary
Modifier and TypeMethodDescriptionReturns an enumeration of all Coptic month names.protected StringReturns the era suffix for Coptic years (empty).static booleanisLeapYear(int i) Checks if the given year is a leap year in the Coptic calendar.static voidMain method for testing the Coptic calendar implementation.protected StringReturns the name of the current month.protected voidRecomputes the month, day, and year from the current Rata Die number.protected voidRecomputes the Rata Die number from the current month, day, and year.toString()Returns a string representation of the Coptic date.Methods inherited from class JulianCalendar
setMethods inherited from class GregorianCalendar
dayNumber, daysLeftMethods inherited from class MonthDayYear
getDay, getMonth, getYear, setMethods inherited from class SevenDaysWeek
kDayAfter, kDayBefore, kDayNearest, kDayOnOrAfter, kDayOnOrBefore, nthKDay, weekDay, weekDayNameMethods inherited from class AlternateCalendar
add, amod, difference, difference, floorDiv, fromJD, isAfter, isBefore, mod, mod, subtract, toJD, toJD, toRD
-
Field Details
-
EPOCH
public static long EPOCHThe RD number of the Coptic epoch (August 29, 284 CE Julian).
-
-
Constructor Details
-
CopticCalendar
public CopticCalendar()Creates a new CopticCalendar object. -
CopticCalendar
public CopticCalendar(long l) Creates a new CopticCalendar object.- Parameters:
l- the Rata Die number.
-
CopticCalendar
Creates a new CopticCalendar object.- Parameters:
altcalendar- another calendar to initialize from.
-
CopticCalendar
public CopticCalendar(int i, int j, int k) Creates a new CopticCalendar object.- Parameters:
i- the month (1-13).j- the day.k- the year.
-
-
Method Details
-
isLeapYear
public static boolean isLeapYear(int i) Checks if the given year is a leap year in the Coptic calendar.- Parameters:
i- the year to check.- Returns:
- true if it is a leap year.
-
recomputeRD
protected void recomputeRD()Recomputes the Rata Die number from the current month, day, and year.- Overrides:
recomputeRDin classJulianCalendar
-
recomputeFromRD
protected void recomputeFromRD()Recomputes the month, day, and year from the current Rata Die number.- Overrides:
recomputeFromRDin classJulianCalendar
-
monthName
Returns the name of the current month.- Overrides:
monthNamein classGregorianCalendar- Returns:
- the month name string.
-
getSuffix
Returns the era suffix for Coptic years (empty).- Overrides:
getSuffixin classJulianCalendar- Returns:
- an empty string.
-
getMonths
Returns an enumeration of all Coptic month names.- Overrides:
getMonthsin classGregorianCalendar- Returns:
- enumeration of month names.
-
toString
Returns a string representation of the Coptic date.- Overrides:
toStringin classJulianCalendar- Returns:
- the date string.
-
main
Main method for testing the Coptic calendar implementation.- Parameters:
args- command line arguments.
-