Class OldHinduLunarCalendar
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
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ModifiedHinduLunarBRCalendar, ModifiedHinduLunarCalendar
Implementation of the Old Hindu Lunar calendar (Surya Siddhanta).
* @version 2.1
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTrue if the current month is a leap month (adhika mÄsa).protected static final RationalThe length of a tithi (lunar day) in days.protected static final RationalThe length of a synodic month (new moon to new moon) in days.protected static final String[]List of Hindu lunar month names.Fields 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
ConstructorsConstructorDescriptionOldHinduLunarCalendar(int i, boolean flag, int j, int k) OldHinduLunarCalendar(int i, int j, int k) OldHinduLunarCalendar(long l) OldHinduLunarCalendar(AlternateCalendar altcalendar) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetLeap()Returns an enumeration of all month names for this calendar.protected StringReturns the era suffix for display (e.g., "CE", "BCE", "AH").protected static booleanisLeapYear(int i) static voidprotected StringReturns the name of the current month.protected voidRecomputes the calendar-specific fields from the current Rata Die.protected voidRecomputes the Rata Die from the calendar-specific fields.voidset(int i, boolean flag, int j, int k) voidset(int i, int j, int k) Sets the calendar to the specified date and recomputes the Rata Die.voidset(long l) Sets this calendar to the specified Rata Die and recomputes the calendar fields.Methods inherited from class OldHinduSolarCalendar
dayCount, jovianYearMethods inherited from class MonthDayYear
getDay, getMonth, getYear, toStringMethods 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
-
MONTHS
List of Hindu lunar month names. -
LUNARMONTH
The length of a synodic month (new moon to new moon) in days. -
LUNARDAY
The length of a tithi (lunar day) in days. -
leap
protected boolean leapTrue if the current month is a leap month (adhika mÄsa).
-
-
Constructor Details
-
OldHinduLunarCalendar
public OldHinduLunarCalendar() -
OldHinduLunarCalendar
public OldHinduLunarCalendar(long l) -
OldHinduLunarCalendar
-
OldHinduLunarCalendar
public OldHinduLunarCalendar(int i, int j, int k) -
OldHinduLunarCalendar
public OldHinduLunarCalendar(int i, boolean flag, int j, int k)
-
-
Method Details
-
isLeapYear
protected static boolean isLeapYear(int i) -
recomputeFromRD
protected void recomputeFromRD()Description copied from class:AlternateCalendarRecomputes the calendar-specific fields from the current Rata Die. Called after setting the RD value.- Overrides:
recomputeFromRDin classOldHinduSolarCalendar
-
recomputeRD
protected void recomputeRD()Description copied from class:AlternateCalendarRecomputes the Rata Die from the calendar-specific fields. Called after setting individual calendar fields.- Overrides:
recomputeRDin classOldHinduSolarCalendar
-
set
public void set(int i, int j, int k) Description copied from class:MonthDayYearSets the calendar to the specified date and recomputes the Rata Die.- Overrides:
setin classOldHinduSolarCalendar- Parameters:
i- the yearj- the monthk- the day of month
-
set
public void set(int i, boolean flag, int j, int k) -
set
public void set(long l) Description copied from class:AlternateCalendarSets this calendar to the specified Rata Die and recomputes the calendar fields.- Overrides:
setin classOldHinduSolarCalendar- Parameters:
l- the new Rata Die value
-
monthName
Description copied from class:MonthDayYearReturns the name of the current month.- Overrides:
monthNamein classOldHinduSolarCalendar- Returns:
- the month name
-
getSuffix
Description copied from class:MonthDayYearReturns the era suffix for display (e.g., "CE", "BCE", "AH").- Overrides:
getSuffixin classOldHinduSolarCalendar- Returns:
- the suffix string
-
getMonths
Description copied from class:MonthDayYearReturns an enumeration of all month names for this calendar.- Overrides:
getMonthsin classOldHinduSolarCalendar- Returns:
- month names enumeration
-
getLeap
public boolean getLeap() -
main
-