Class ModifiedHinduLunarCalendar
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.OldHinduSolarCalendar
org.episteme.social.history.calendars.OldHinduLunarCalendar
org.episteme.social.history.calendars.ModifiedHinduLunarCalendar
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTrue if this is a duplicated (leap) day.protected static final intOffset for the lunar era (Vikrama Era).protected static org.episteme.social.history.calendars.ModifiedHinduCalendarDelegate for Hindu astronomical calculations.Fields inherited from class OldHinduLunarCalendar
leap, LUNARDAY, LUNARMONTH, MONTHSFields inherited from class OldHinduSolarCalendar
EPOCH, JOVIANPERIOD, SIDEREALYEAR, SOLARMONTHFields 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 ModifiedHinduLunarCalendar object.ModifiedHinduLunarCalendar(int i, boolean flag, int j, boolean flag1, int k) Creates a new ModifiedHinduLunarCalendar object.ModifiedHinduLunarCalendar(long l) Creates a new ModifiedHinduLunarCalendar object.ModifiedHinduLunarCalendar(AlternateCalendar altcalendar) Creates a new ModifiedHinduLunarCalendar object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the current day is a leap day.Returns the era suffix for this calendar.static voidMain method for testing Hindu lunar calendar calculations.booleanprecedes(ModifiedHinduLunarCalendar modhindulunar) Checks if this date precedes another Hindu lunar date.voidRecomputes the Hindu lunar date components from the current Rata Die number.voidRecomputes the Rata Die number from the current Hindu lunar date components.voidset(int i, boolean flag, int j, boolean flag1, int k) Sets the Hindu lunar date components.toString()Returns a string representation of the Hindu lunar date.Methods inherited from class OldHinduLunarCalendar
getLeap, getMonths, isLeapYear, monthName, set, set, setMethods inherited from class OldHinduSolarCalendar
dayCount, jovianYearMethods inherited from class MonthDayYear
getDay, getMonth, getYearMethods 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
-
LUNARERA
protected static final int LUNARERAOffset for the lunar era (Vikrama Era).- See Also:
-
mh
protected static org.episteme.social.history.calendars.ModifiedHinduCalendar mhDelegate for Hindu astronomical calculations. -
leapday
protected boolean leapdayTrue 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
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:
recomputeFromRDin classOldHinduLunarCalendar
-
precedes
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:
recomputeRDin classOldHinduLunarCalendar- 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
Returns a string representation of the Hindu lunar date.- Overrides:
toStringin classMonthDayYear- Returns:
- string representation.
-
getSuffix
Returns the era suffix for this calendar.- Overrides:
getSuffixin classOldHinduLunarCalendar- Returns:
- the suffix string.
-
main
Main method for testing Hindu lunar calendar calculations.- Parameters:
args- command line arguments.
-