Class AbstractCalendarInfo
java.lang.Object
net.okapia.osid.primordium.calendaring.framework.spi.AbstractCalendarInfo
- All Implemented Interfaces:
Serializable, CalendarInfo
- Direct Known Subclasses:
AbstractDarianCalendar, AbstractDayCountCalendar, AbstractEpagomenalCalendar, AbstractWesternCalendar, BahaiCalendar, ByzantineCalendar, C360Calendar, ChineseCalendar, CommonCivilCalendar, DiscordianCalendar, HankeHenryCalendar, HebrewCalendar, IndianNationalCalendar, InternationalFixedCalendar, IslamicCivilCalendar, IslamicTabularCalendar, JavaneseCalendar, KingsReckoningCalendar, KurdishCalendar, NanakshahiCalendar, PaxCalendar, PositivistCalendar, RumiCalendar, ShireCalendar, SolarHijriCalendar, Symmetry454Calendar, TranquilityCalendar, WorldCalendar
A convenience base for a calendar's dedicated
CalendarInfo
implementation. It supplies the common defaults -- deterministic, a fixed
(not derived) epoch, no cycles -- so a concrete calendar overrides only
its specifics: name, type, the main division, and its epoch. An anchored
calendar (the Hebrew year) overrides the epoch accessors to be derived; a
non-deterministic one overrides isDeterministic().- See Also:
-
Constructor Summary
Constructors -
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.longGets the fixed epoch Julian Day; valid whenCalendarInfo.isEpochFixed().Gets the epoch derivation rule; valid whenCalendarInfo.isEpochDerived().Gets the main (top) division -- the year.getName()Gets the calendar name.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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CalendarInfo
getEpochAbbrev, getEpochName, getPreEpochAbbrev, getPreEpochName, isEpochNamed, startsDayAtStartOfClockModifier and TypeMethodDescriptiondefault DisplayTextGets the short form of the name of the time from the epoch onward, as AD abbreviates Anno Domini; valid whenCalendarInfo.isEpochNamed().default DisplayTextGets the name of the time from the epoch onward, as Anno Domini names it in the Gregorian calendar; valid whenCalendarInfo.isEpochNamed().default DisplayTextGets the short form of the name of the time before the first day of the calendar, as BC abbreviates Before Christ; valid whenCalendarInfo.isEpochNamed().default DisplayTextGets the name of the time before the first day of the calendar, as Before Christ names it in the Gregorian calendar; valid whenCalendarInfo.isEpochNamed().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.
-
Constructor Details
-
AbstractCalendarInfo
public AbstractCalendarInfo()Constructs a newAbstractCalendarInfo.
-
-
Method Details
-
getName
Description copied from interface:CalendarInfoGets the calendar name.- Specified by:
getNamein interfaceCalendarInfo- Returns:
- the name
-
getDescription
Description copied from interface:CalendarInfoGets the calendar description.- Specified by:
getDescriptionin interfaceCalendarInfo- Returns:
- the description
-
getCalendarType
Description copied from interface:CalendarInfoGets the calendar type.- Specified by:
getCalendarTypein interfaceCalendarInfo- Returns:
- the calendar type
-
isDeterministic
public boolean isDeterministic()Description copied from interface:CalendarInfoTests whether rollover and leaping are predictable -- the condition for converting this calendar to another.- Specified by:
isDeterministicin interfaceCalendarInfo- Returns:
trueif deterministic
-
getMainDivision
Description copied from interface:CalendarInfoGets the main (top) division -- the year.- Specified by:
getMainDivisionin interfaceCalendarInfo- Returns:
- the main division
-
isEpochFixed
public boolean isEpochFixed()Description copied from interface:CalendarInfoTests whether the epoch is a fixed Julian Day.- Specified by:
isEpochFixedin interfaceCalendarInfo- Returns:
trueif the epoch is fixed
-
getEpochAsJulianDay
public long getEpochAsJulianDay()Description copied from interface:CalendarInfoGets the fixed epoch Julian Day; valid whenCalendarInfo.isEpochFixed().- Specified by:
getEpochAsJulianDayin interfaceCalendarInfo- Returns:
- the epoch Julian Day
-
isEpochDerived
public boolean isEpochDerived()Description copied from interface:CalendarInfoTests whether the epoch is derived from a rule.- Specified by:
isEpochDerivedin interfaceCalendarInfo- Returns:
trueif the epoch is derived
-
getEpochRule
Description copied from interface:CalendarInfoGets the epoch derivation rule; valid whenCalendarInfo.isEpochDerived().- Specified by:
getEpochRulein interfaceCalendarInfo- Returns:
- the epoch rule
-
getCycles
Description copied from interface:CalendarInfoGets the free-running cycles (the weekday) that ride alongside the division tree.- Specified by:
getCyclesin interfaceCalendarInfo- Returns:
- the cycles, or
null
-