Class MonthDayYear

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ChineseCalendar, GregorianCalendar, HebrewCalendar, IslamicCalendar, ModifiedFrenchCalendar, OldHinduSolarCalendar, PersianCalendar

public abstract class MonthDayYear extends SevenDaysWeek
Abstract base class for calendar systems that use a month-day-year date representation. Extends SevenDaysWeek to include weekday calculations.

Subclasses must implement:

Since:
1.0
Version:
2.0
Author:
Mark E. Shoulson (original implementation), Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Field Details

    • month

      protected int month
      The month (1-12 for most calendars).
    • day

      protected int day
      The day of the month (1-31 for most calendars).
    • year

      protected int year
      The year (negative values typically represent BCE years).
  • Constructor Details

    • MonthDayYear

      public MonthDayYear()
      Default constructor.
  • Method Details

    • getDay

      public int getDay()
      Returns the day of the month.
      Returns:
      the day (typically 1-31)
    • getMonth

      public int getMonth()
      Returns the month.
      Returns:
      the month (typically 1-12)
    • getYear

      public int getYear()
      Returns the year.
      Returns:
      the year (negative for BCE)
    • set

      public void set(int year, int month, int day)
      Sets the calendar to the specified date and recomputes the Rata Die.
      Parameters:
      year - the year
      month - the month
      day - the day of month
    • toString

      public String toString()
      Returns a string representation of this date.
      Specified by:
      toString in class AlternateCalendar
      Returns:
      formatted date string
    • monthName

      protected abstract String monthName()
      Returns the name of the current month.
      Returns:
      the month name
    • getSuffix

      protected abstract String getSuffix()
      Returns the era suffix for display (e.g., "CE", "BCE", "AH").
      Returns:
      the suffix string
    • getMonths

      public abstract Enumeration<String> getMonths()
      Returns an enumeration of all month names for this calendar.
      Returns:
      month names enumeration