Class ModifiedFrenchCalendar
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.ModifiedFrenchCalendar
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FrenchCalendar
Implementation of the French Republican Calendar (modified version).
The French Republican Calendar was created during the French Revolution
and was in official use from 1793 to 1805.
Key features:
- Epoch: September 22, 1792 (Autumnal Equinox)
- 12 months of 30 days each, plus 5-6 complementary days
- 10-day weeks (décades) replacing the 7-day week
- Modified leap year rule for long-term accuracy
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String[]Day names for the 10-day decade.protected static final longThe RD number for the French Republican epoch (September 22, 1792).protected static final String[]Names for the complementary sans-culottides days.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 ModifiedFrenchCalendar object.ModifiedFrenchCalendar(int i, int j, int k) Creates a new ModifiedFrenchCalendar object.ModifiedFrenchCalendar(long l) Creates a new ModifiedFrenchCalendar object.ModifiedFrenchCalendar(AlternateCalendar altcalendar) Creates a new ModifiedFrenchCalendar object. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the decade number within the month (1-3).Returns an enumeration of all French month names.protected StringReturns the era suffix for the French calendar (none).intReturns the day within the 10-day decade (1-10).static booleanisLeapYear(int i) Checks if the given year is a leap year in the French Republican calendar.static voidMain method for testing the Modified French 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.voidset(long l) Sets the Rata Die number and recomputes the date.toString()Returns a string representation of the French date.Methods 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
protected static final long EPOCHThe RD number for the French Republican epoch (September 22, 1792). -
DAYS
Day names for the 10-day decade. -
JOURS
Names for the complementary sans-culottides days.
-
-
Constructor Details
-
ModifiedFrenchCalendar
public ModifiedFrenchCalendar()Creates a new ModifiedFrenchCalendar object. -
ModifiedFrenchCalendar
public ModifiedFrenchCalendar(long l) Creates a new ModifiedFrenchCalendar object.- Parameters:
l- the Rata Die number.
-
ModifiedFrenchCalendar
public ModifiedFrenchCalendar(int i, int j, int k) Creates a new ModifiedFrenchCalendar object.- Parameters:
i- the month (1-13).j- the day.k- the year.
-
ModifiedFrenchCalendar
Creates a new ModifiedFrenchCalendar object.- Parameters:
altcalendar- another calendar to initialize from.
-
-
Method Details
-
isLeapYear
public static boolean isLeapYear(int i) Checks if the given year is a leap year in the French Republican calendar.- Parameters:
i- the year to check.- Returns:
- true if it is a leap year.
-
set
public void set(long l) Sets the Rata Die number and recomputes the date.- Specified by:
setin classAlternateCalendar- Parameters:
l- the Rata Die number.
-
recomputeRD
protected void recomputeRD()Recomputes the Rata Die number from the current month, day, and year.- Specified by:
recomputeRDin classAlternateCalendar
-
recomputeFromRD
protected void recomputeFromRD()Recomputes the month, day, and year from the current Rata Die number.- Specified by:
recomputeFromRDin classAlternateCalendar
-
getWeekDay
public int getWeekDay()Returns the day within the 10-day decade (1-10).- Returns:
- the day number.
-
getDecade
public int getDecade()Returns the decade number within the month (1-3).- Returns:
- the decade number.
-
monthName
Returns the name of the current month.- Specified by:
monthNamein classMonthDayYear- Returns:
- the month name string.
-
getSuffix
Returns the era suffix for the French calendar (none).- Specified by:
getSuffixin classMonthDayYear- Returns:
- an empty string.
-
getMonths
Returns an enumeration of all French month names.- Specified by:
getMonthsin classMonthDayYear- Returns:
- enumeration of month names.
-
toString
Returns a string representation of the French date.- Overrides:
toStringin classMonthDayYear- Returns:
- the date string.
-
main
Main method for testing the Modified French calendar implementation.- Parameters:
args- command line arguments.
-