Class ModifiedHinduLunarCalendar

All Implemented Interfaces:
Serializable

public class ModifiedHinduLunarCalendar extends OldHinduLunarCalendar
Modified Hindu Lunar calendar using floating-point arithmetic. This calendar uses modern astronomical calculations for lunar month determinations with support for leap months and leap days. * @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Field Details

    • LUNARERA

      protected static final int LUNARERA
      Offset for the lunar era (Vikrama Era).
      See Also:
    • mh

      protected static org.episteme.social.history.calendars.ModifiedHinduCalendar mh
      Delegate for Hindu astronomical calculations.
    • leapday

      protected boolean leapday
      True if this is a duplicated (leap) day.
  • Constructor Details

    • ModifiedHinduLunarCalendar

      public ModifiedHinduLunarCalendar(long l)
      Creates a new ModifiedHinduLunarCalendar object.
      Parameters:
      l - Rata Die number.
    • ModifiedHinduLunarCalendar

      public ModifiedHinduLunarCalendar(AlternateCalendar altcalendar)
      Creates a new ModifiedHinduLunarCalendar object.
      Parameters:
      altcalendar - another calendar to initialize from.
    • ModifiedHinduLunarCalendar

      public ModifiedHinduLunarCalendar()
      Creates a new ModifiedHinduLunarCalendar object.
    • ModifiedHinduLunarCalendar

      public ModifiedHinduLunarCalendar(int i, boolean flag, int j, boolean flag1, int k)
      Creates a new ModifiedHinduLunarCalendar object.
      Parameters:
      i - the month number.
      flag - true if leap month.
      j - the day number.
      flag1 - true if leap day.
      k - the year number.
  • Method Details

    • set

      public void set(int i, boolean flag, int j, boolean flag1, int k)
      Sets the Hindu lunar date components.
      Parameters:
      i - the month number.
      flag - true if leap month.
      j - the day number.
      flag1 - true if leap day.
      k - the year number.
    • recomputeFromRD

      public void recomputeFromRD()
      Recomputes the Hindu lunar date components from the current Rata Die number.
      Overrides:
      recomputeFromRD in class OldHinduLunarCalendar
    • precedes

      public boolean precedes(ModifiedHinduLunarCalendar modhindulunar)
      Checks if this date precedes another Hindu lunar date.
      Parameters:
      modhindulunar - the other date.
      Returns:
      true if this date is before the other.
    • recomputeRD

      public void recomputeRD()
      Recomputes the Rata Die number from the current Hindu lunar date components.
      Overrides:
      recomputeRD in class OldHinduLunarCalendar
      Throws:
      InconsistentDateException - if the date is invalid.
    • getLeapDay

      public boolean getLeapDay()
      Returns true if the current day is a leap day.
      Returns:
      true if leap day.
    • toString

      public String toString()
      Returns a string representation of the Hindu lunar date.
      Overrides:
      toString in class MonthDayYear
      Returns:
      string representation.
    • getSuffix

      public String getSuffix()
      Returns the era suffix for this calendar.
      Overrides:
      getSuffix in class OldHinduLunarCalendar
      Returns:
      the suffix string.
    • main

      public static void main(String[] args)
      Main method for testing Hindu lunar calendar calculations.
      Parameters:
      args - command line arguments.