Class ModifiedFrenchCalendar

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FrenchCalendar

public class ModifiedFrenchCalendar extends MonthDayYear
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
* @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Field Details

    • EPOCH

      protected static final long EPOCH
      The RD number for the French Republican epoch (September 22, 1792).
    • DAYS

      protected static final String[] DAYS
      Day names for the 10-day decade.
    • JOURS

      protected static final String[] 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

      public ModifiedFrenchCalendar(AlternateCalendar altcalendar)
      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:
      set in class AlternateCalendar
      Parameters:
      l - the Rata Die number.
    • recomputeRD

      protected void recomputeRD()
      Recomputes the Rata Die number from the current month, day, and year.
      Specified by:
      recomputeRD in class AlternateCalendar
    • recomputeFromRD

      protected void recomputeFromRD()
      Recomputes the month, day, and year from the current Rata Die number.
      Specified by:
      recomputeFromRD in class AlternateCalendar
    • 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

      protected String monthName()
      Returns the name of the current month.
      Specified by:
      monthName in class MonthDayYear
      Returns:
      the month name string.
    • getSuffix

      protected String getSuffix()
      Returns the era suffix for the French calendar (none).
      Specified by:
      getSuffix in class MonthDayYear
      Returns:
      an empty string.
    • getMonths

      public Enumeration<String> getMonths()
      Returns an enumeration of all French month names.
      Specified by:
      getMonths in class MonthDayYear
      Returns:
      enumeration of month names.
    • toString

      public String toString()
      Returns a string representation of the French date.
      Overrides:
      toString in class MonthDayYear
      Returns:
      the date string.
    • main

      public static void main(String[] args)
      Main method for testing the Modified French calendar implementation.
      Parameters:
      args - command line arguments.