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
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 Summary
Modifier and TypeMethodDescriptionGets the calendar type.Gets the free-running cycles (the weekday) that ride alongside the division tree.Gets the calendar description.default DisplayTextGets the short form of the name of the time from the epoch onward, as AD abbreviates Anno Domini; valid whenisEpochNamed().longGets the fixed epoch Julian Day; valid whenisEpochFixed().default DisplayTextGets the name of the time from the epoch onward, as Anno Domini names it in the Gregorian calendar; valid whenisEpochNamed().Gets the epoch derivation rule; valid whenisEpochDerived().Gets the main (top) division -- the year.getName()Gets the calendar name.default DisplayTextGets the short form of the name of the time before the first day of the calendar, as BC abbreviates Before Christ; valid whenisEpochNamed().default DisplayTextGets the name of the time before the first day of the calendar, as Before Christ names it in the Gregorian calendar; valid whenisEpochNamed().booleanTests whether rollover and leaping are predictable -- the condition for converting this calendar to another.booleanTests whether the epoch is derived from a rule.booleanTests whether the epoch is a fixed Julian Day.default booleanTests whether the calendar names the time on either side of its epoch.default booleanTests 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.
-
Method Details
-
getName
-
getDescription
-
getCalendarType
-
isDeterministic
boolean isDeterministic()Tests whether rollover and leaping are predictable -- the condition for converting this calendar to another.- Returns:
trueif 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. Whentrue, 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. Whenfalse, 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 totrue.- Returns:
trueif 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:
trueif the epoch is fixed
-
getEpochAsJulianDay
long getEpochAsJulianDay()Gets the fixed epoch Julian Day; valid whenisEpochFixed().- Returns:
- the epoch Julian Day
-
isEpochDerived
boolean isEpochDerived()Tests whether the epoch is derived from a rule.- Returns:
trueif the epoch is derived
-
getEpochRule
EpochRule getEpochRule()Gets the epoch derivation rule; valid whenisEpochDerived().- 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 answerfalse.- Returns:
trueif the eras are named
-
getEpochName
Gets the name of the time from the epoch onward, as Anno Domini names it in the Gregorian calendar; valid whenisEpochNamed().- Returns:
- the name of the era
-
getEpochAbbrev
Gets the short form of the name of the time from the epoch onward, as AD abbreviates Anno Domini; valid whenisEpochNamed().- Returns:
- the abbreviated name of the era
-
getPreEpochName
Gets the name of the time before the first day of the calendar, as Before Christ names it in the Gregorian calendar; valid whenisEpochNamed().- Returns:
- the name of the era before the epoch
-
getPreEpochAbbrev
Gets the short form of the name of the time before the first day of the calendar, as BC abbreviates Before Christ; valid whenisEpochNamed().- 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
-