Class MayanCalendar
java.lang.Object
org.episteme.social.history.calendars.AlternateCalendar
org.episteme.social.history.calendars.MayanCalendar
- All Implemented Interfaces:
Serializable
Implementation of the Mayan calendar system.
The Mayan calendar consists of several interlocking cycles including the
Long Count, Haab (365-day civil calendar), and Tzolkin (260-day ritual calendar).
Key features:
- Long Count: B'ak'tun.K'atun.Tun.Winal.K'in format
- Haab: 18 months of 20 days + 5 Wayeb days
- Tzolkin: 13 numbers × 20 day names = 260 days
- Calendar Round: 52-year cycle combining Haab and Tzolkin
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
Fields inherited from class AlternateCalendar
JD_EPOCH, rd, unicode -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new MayanCalendar object.protectedMayanCalendar(int i, int j, int k, int l) Creates a new MayanCalendar object.MayanCalendar(int i, int j, int k, int l, int i1) Creates a new MayanCalendar object.MayanCalendar(long l) Creates a new MayanCalendar object.MayanCalendar(AlternateCalendar altcalendar) Creates a new MayanCalendar object. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Long Count representation as a dot-separated string.static voidMain method for testing the Mayan calendar implementation.protected voidRecomputes the Mayan date components from the current Rata Die number.protected voidRecomputes the Rata Die number.voidset(int i, int j, int k, int l, int i1) Sets the Mayan Long Count parameters and recomputes the date.voidset(long l) Sets the Rata Die number and recomputes Mayan fields.toString()Returns a string representation of the Mayan date (Long Count, Tzolkin, and Haab).Methods inherited from class AlternateCalendar
add, amod, difference, difference, floorDiv, fromJD, isAfter, isBefore, mod, mod, subtract, toJD, toJD, toRD
-
Constructor Details
-
MayanCalendar
public MayanCalendar()Creates a new MayanCalendar object. -
MayanCalendar
public MayanCalendar(int i, int j, int k, int l, int i1) Creates a new MayanCalendar object.- Parameters:
i- the B'ak'tun.j- the K'atun.k- the Tun.l- the Winal.i1- the K'in.
-
MayanCalendar
public MayanCalendar(long l) Creates a new MayanCalendar object.- Parameters:
l- the Rata Die number.
-
MayanCalendar
Creates a new MayanCalendar object.- Parameters:
altcalendar- another calendar to initialize from.
-
MayanCalendar
protected MayanCalendar(int i, int j, int k, int l) Creates a new MayanCalendar object.- Parameters:
i- Haab day.j- Haab month.k- Tzolkin number.l- Tzolkin name.
-
-
Method Details
-
set
public void set(int i, int j, int k, int l, int i1) Sets the Mayan Long Count parameters and recomputes the date.- Parameters:
i- B'ak'tun.j- K'atun.k- Tun.l- Winal.i1- K'in.
-
recomputeFromRD
protected void recomputeFromRD()Recomputes the Mayan date components from the current Rata Die number.- Specified by:
recomputeFromRDin classAlternateCalendar
-
recomputeRD
protected void recomputeRD()Recomputes the Rata Die number. Mayan components use Rata Die directly.- Specified by:
recomputeRDin classAlternateCalendar
-
set
public void set(long l) Sets the Rata Die number and recomputes Mayan fields.- Specified by:
setin classAlternateCalendar- Parameters:
l- the Rata Die number.
-
longCountString
Returns the Long Count representation as a dot-separated string.- Returns:
- the long count string.
-
toString
Returns a string representation of the Mayan date (Long Count, Tzolkin, and Haab).- Specified by:
toStringin classAlternateCalendar- Returns:
- the date string.
-
main
Main method for testing the Mayan calendar implementation.- Parameters:
args- command line arguments.
-