Interface CalendarInfo

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractCalendarInfo, AbstractDarianCalendar, AbstractDayCountCalendar, AbstractEpagomenalCalendar, AbstractWesternCalendar, AnnunciationJulianCalendar, AnsiDateCalendar, ArmenianCalendar, BahaiCalendar, BerberCalendar, BuddhistCalendar, ByzantineCalendar, C360Calendar, ChineseCalendar, ChineseMarsCalendar, CommonCivilCalendar, CopticCalendar, DarianCalendar, DiscordianCalendar, DublinJulianDayCalendar, EgyptianCalendar, EthiopianCalendar, FlorentineCalendar, FrenchRepublicanCalendar, GregorianCalendar, HankeHenryCalendar, HebrewCalendar, HoloceneCalendar, IndianNationalCalendar, InternationalFixedCalendar, IslamicCivilCalendar, IslamicTabularCalendar, ISOCalendar, JapaneseCalendar, JavaneseCalendar, JucheCalendar, JulianCalendar, JulianDayCalendar, KingsReckoningCalendar, KoreanDangiCalendar, KurdishCalendar, LilianCalendar, MayaLongCountCalendar, MinguoCalendar, ModifiedJulianDayCalendar, NanakshahiCalendar, PaxCalendar, PositivistCalendar, RataDieCalendar, ReducedJulianDayCalendar, RevisedJulianCalendar, RotterdamCalendar, RumiCalendar, RunicCalendar, ShireCalendar, SolarHijriCalendar, SovietCalendar, Symmetry454Calendar, ThaiSolarCalendar, TranquilityCalendar, TruncatedJulianDayCalendar, UnixCalendar, UtopianCalendar, WorldCalendar, ZoroastrianCalendar

public interface CalendarInfo extends Serializable
A calendar described as a system of subdivisions: a tree of CalendarDivisions rooted at the main division (the year) and bottoming out at DAY (the day-number axis), plus any free-running CalendarCycles (the weekday) that ride alongside. The date-to-day-number bridge is the mixed-radix value of the containment path from the epoch; the time of day below DAY is a separate, swappable concern.

Implemented by the various calendars; BasicCalendarInfo is a builder-backed default implementation for data-only calendars.

  • Method Details

    • getName

      DisplayText getName()
      Gets the calendar name.
      Returns:
      the name
    • getDescription

      DisplayText getDescription()
      Gets the calendar description.
      Returns:
      the description
    • getCalendarType

      Type getCalendarType()
      Gets the calendar type.
      Returns:
      the calendar type
    • isDeterministic

      boolean isDeterministic()
      Tests whether rollover and leaping are predictable -- the condition for converting this calendar to another.
      Returns:
      true if deterministic
    • startsDayAtStartOfClock

      default boolean startsDayAtStartOfClock()
      Tests whether this calendar's day begins at the start of the clock -- the zero of the time of day (midnight on a 24-hour clock) -- as opposed to an offset reckoning such as sunset (Hebrew, Islamic) or sunrise. When true, a calendar day coincides with a Julian Day on the shared timeline, so an instant's date does not depend on its time of day. When false, the date of a sub-day instant depends on whether it falls before or after the offset, which the midnight-based day-number axis cannot resolve without astronomical data -- so such an instant cannot be converted into this calendar. Defaults to true.
      Returns:
      true if the day begins at the start of the clock
    • getMainDivision

      CalendarDivision getMainDivision()
      Gets the main (top) division -- the year.
      Returns:
      the main division
    • isEpochFixed

      boolean isEpochFixed()
      Tests whether the epoch is a fixed Julian Day.
      Returns:
      true if the epoch is fixed
    • getEpochAsJulianDay

      long getEpochAsJulianDay()
      Gets the fixed epoch Julian Day; valid when isEpochFixed().
      Returns:
      the epoch Julian Day
    • isEpochDerived

      boolean isEpochDerived()
      Tests whether the epoch is derived from a rule.
      Returns:
      true if the epoch is derived
    • getEpochRule

      EpochRule getEpochRule()
      Gets the epoch derivation rule; valid when isEpochDerived().
      Returns:
      the epoch rule
    • isEpochNamed

      default boolean isEpochNamed()
      Tests whether the calendar names the time on either side of its epoch. A calendar that counts forward from its epoch and never looks behind it names nothing, and neither does one whose years are numbered astronomically; both answer false.
      Returns:
      true if the eras are named
    • getEpochName

      default DisplayText getEpochName()
      Gets the name of the time from the epoch onward, as Anno Domini names it in the Gregorian calendar; valid when isEpochNamed().
      Returns:
      the name of the era
    • getEpochAbbrev

      default DisplayText getEpochAbbrev()
      Gets the short form of the name of the time from the epoch onward, as AD abbreviates Anno Domini; valid when isEpochNamed().
      Returns:
      the abbreviated name of the era
    • getPreEpochName

      default DisplayText getPreEpochName()
      Gets the name of the time before the first day of the calendar, as Before Christ names it in the Gregorian calendar; valid when isEpochNamed().
      Returns:
      the name of the era before the epoch
    • getPreEpochAbbrev

      default DisplayText getPreEpochAbbrev()
      Gets the short form of the name of the time before the first day of the calendar, as BC abbreviates Before Christ; valid when isEpochNamed().
      Returns:
      the abbreviated name of the era before the epoch
    • getCycles

      CalendarCycle[] getCycles()
      Gets the free-running cycles (the weekday) that ride alongside the division tree.
      Returns:
      the cycles, or null