Class BahaiCalendar
java.lang.Object
org.episteme.social.history.calendars.AlternateCalendar
org.episteme.social.history.calendars.SevenDaysWeek
org.episteme.social.history.calendars.BahaiCalendar
- All Implemented Interfaces:
Serializable
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)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe RD number of the Bahá'à epoch (March 21, 1844).Fields 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 BahaiCalendar object.BahaiCalendar(int i, int j, int k, int l, int i1) Creates a new BahaiCalendar object.BahaiCalendar(long l) Creates a new BahaiCalendar object.BahaiCalendar(AlternateCalendar altcalendar) Creates a new BahaiCalendar object. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain method for testing the Bahá'à calendar implementation.voidRecomputes the Bahá'à date fields from the current Rata Die number.voidRecomputes the Rata Die number from the Bahá'à date fields.voidset(int i, int j, int k, int l, int i1) Sets the Bahá'à cycle components and recomputes the Rata Die date.voidset(long l) Sets the Rata Die number and recomputes the date fields.toString()Returns a string representation of the Bahá'à date.Methods 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 final long EPOCHThe 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
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:
setin classAlternateCalendar- 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:
recomputeRDin classAlternateCalendar
-
recomputeFromRD
public void recomputeFromRD()Recomputes the Bahá'à date fields from the current Rata Die number.- Specified by:
recomputeFromRDin classAlternateCalendar
-
toString
Returns a string representation of the Bahá'à date.- Specified by:
toStringin classAlternateCalendar- Returns:
- the date string.
-
main
Main method for testing the Bahá'à calendar implementation.- Parameters:
args- command line arguments.
-