Class BahaiCalendar

All Implemented Interfaces:
Serializable

public class BahaiCalendar extends SevenDaysWeek
Implementation of the Bahá'í (Badí') calendar. The Bahá'í calendar is a solar calendar used by the Bahá'í Faith, consisting of 19 months of 19 days, plus intercalary days.

Key features:

  • Epoch: March 21, 1844 CE
  • 19 months of 19 days each (361 days)
  • 4-5 intercalary days (Ayyám-i-Há)
  • 19-year cycles (Váhid) and 361-year major cycles (Kull-i-Shay)
* @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Field Details

    • EPOCH

      public static final long EPOCH
      The RD number of the Bahá'í epoch (March 21, 1844).
  • Constructor Details

    • BahaiCalendar

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

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

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

      public BahaiCalendar(int i, int j, int k, int l, int i1)
      Creates a new BahaiCalendar object.
      Parameters:
      i - the Kull-i-Shay (major cycle).
      j - the Váhid (cycle).
      k - the year within Váhid.
      l - the month.
      i1 - the day.
  • Method Details

    • set

      public void set(long l)
      Sets the Rata Die number and recomputes the date fields.
      Specified by:
      set in class AlternateCalendar
      Parameters:
      l - the Rata Die number.
    • set

      public void set(int i, int j, int k, int l, int i1)
      Sets the Bahá'í cycle components and recomputes the Rata Die date.
      Parameters:
      i - the Kull-i-Shay.
      j - the Váhid.
      k - the year.
      l - the month.
      i1 - the day.
    • recomputeRD

      public void recomputeRD()
      Recomputes the Rata Die number from the Bahá'í date fields.
      Specified by:
      recomputeRD in class AlternateCalendar
    • recomputeFromRD

      public void recomputeFromRD()
      Recomputes the Bahá'í date fields from the current Rata Die number.
      Specified by:
      recomputeFromRD in class AlternateCalendar
    • toString

      public String toString()
      Returns a string representation of the Bahá'í date.
      Specified by:
      toString in class AlternateCalendar
      Returns:
      the date string.
    • main

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