Class JulianCalendar
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
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CopticCalendar
Implementation of the proleptic Julian calendar.
The Julian calendar was introduced by Julius Caesar in 46 BCE and was the predominant
calendar in the Roman world and subsequently in the Western world until the
Gregorian reform of 1582.
Key differences from the Gregorian calendar:
- Leap year rule: every year divisible by 4 (no century exception)
- Drifts approximately 1 day per 128 years relative to the tropical year
- Uses astronomical year numbering (year 0 = 1 BCE)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic longThe Julian epoch: December 30, 1 BCE (proleptic Gregorian) = January 1, 1 CE (Julian).Fields inherited from class GregorianCalendar
MONTHSFields 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 Julian calendar set to the epoch (January 1, 1 CE).JulianCalendar(int year, int month, int day) Creates a Julian calendar set to the specified date.JulianCalendar(long rataDie) Creates a Julian calendar set to the specified Rata Die.JulianCalendar(AlternateCalendar calendar) Creates a Julian calendar from another calendar's date. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the era suffix for display.static booleanisLeapYear(int year) Determines if the specified year is a leap year in the Julian calendar.protected voidRecomputes the year, month, and day fields from the current Rata Die.protected voidRecomputes the Rata Die from the current year, month, and day fields.voidset(long rataDie) Sets this calendar to the specified Rata Die and recomputes the date fields.toString()Returns a string representation of this date.Methods inherited from class GregorianCalendar
dayNumber, daysLeft, getMonths, monthNameMethods 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 Julian epoch: December 30, 1 BCE (proleptic Gregorian) = January 1, 1 CE (Julian).
-
-
Constructor Details
-
JulianCalendar
public JulianCalendar(long rataDie) Creates a Julian calendar set to the specified Rata Die.- Parameters:
rataDie- the day number
-
JulianCalendar
public JulianCalendar()Creates a Julian calendar set to the epoch (January 1, 1 CE). -
JulianCalendar
Creates a Julian calendar from another calendar's date.- Parameters:
calendar- the source calendar
-
JulianCalendar
public JulianCalendar(int year, int month, int day) Creates a Julian calendar set to the specified date.- Parameters:
year- the year (negative for BCE, using astronomical year numbering)month- the month (1-12)day- the day of month (1-31)
-
-
Method Details
-
recomputeRD
protected void recomputeRD()Recomputes the Rata Die from the current year, month, and day fields.- Overrides:
recomputeRDin classGregorianCalendar
-
recomputeFromRD
protected void recomputeFromRD()Recomputes the year, month, and day fields from the current Rata Die.- Overrides:
recomputeFromRDin classGregorianCalendar
-
set
public void set(long rataDie) Sets this calendar to the specified Rata Die and recomputes the date fields.- Overrides:
setin classGregorianCalendar- Parameters:
rataDie- the new Rata Die value
-
isLeapYear
public static boolean isLeapYear(int year) Determines if the specified year is a leap year in the Julian calendar. In the Julian calendar, every year divisible by 4 is a leap year.- Parameters:
year- the year to check (using astronomical year numbering)- Returns:
- true if it's a leap year
-
getSuffix
Returns the era suffix for display.- Overrides:
getSuffixin classGregorianCalendar- Returns:
- " C.E." for positive years, " B.C.E." for non-positive years
-
toString
Returns a string representation of this date.- Overrides:
toStringin classGregorianCalendar- Returns:
- formatted date string
-