Class MayanCalendar

java.lang.Object
org.episteme.social.history.calendars.AlternateCalendar
org.episteme.social.history.calendars.MayanCalendar
All Implemented Interfaces:
Serializable

public class MayanCalendar extends AlternateCalendar
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
* @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • 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

      public MayanCalendar(AlternateCalendar altcalendar)
      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:
      recomputeFromRD in class AlternateCalendar
    • recomputeRD

      protected void recomputeRD()
      Recomputes the Rata Die number. Mayan components use Rata Die directly.
      Specified by:
      recomputeRD in class AlternateCalendar
    • set

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

      public String longCountString()
      Returns the Long Count representation as a dot-separated string.
      Returns:
      the long count string.
    • toString

      public String toString()
      Returns a string representation of the Mayan date (Long Count, Tzolkin, and Haab).
      Specified by:
      toString in class AlternateCalendar
      Returns:
      the date string.
    • main

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