Interface CalendarDivision
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractCalendarDivision
A level of a calendar -- MONTH, DAY, WEEKDAY -- nested recursively into
finer divisions down to DAY. Its instances are its
CalendarDivisionElements (the months Jan..Dec); the count of the next
level is owned by those elements, not by the division. A division carries
leaping when leap years are reckoned at this level, in one of three
mutually-exclusive ways: a fixed cycle pattern (data), a calculated rule,
or an astronomical ephemeris (which makes the calendar non-deterministic).
BasicCalendarDivision is a builder-backed default
implementation.
-
Method Summary
Modifier and TypeMethodDescriptionlongGets the cycle modulus.long[]Gets the cyclic leaping pattern.longGets the cyclic leaping start.Gets the division description.Gets the ephemeris rule.Gets the leap calculation rule.getName()Gets the division name.Gets the instances of this division.Gets the resolution.Gets the child divisions.booleanTests if leaping is predicted astronomically.booleanTests if leaping is a calculated rule.booleanTests if leaping follows a fixed cycle pattern.booleanTests if this division counts from zero.booleanleaps()Tests if leaping is reckoned at this division.booleanTests if this division maps to a resolution.
-
Method Details
-
getName
-
getDescription
-
mapsToDateTime
boolean mapsToDateTime()Tests if this division maps to a resolution.- Returns:
trueif this division maps to a resolution
-
getResolution
DateTimeResolution getResolution()Gets the resolution.- Returns:
- the DateTimeResolution; valid when
mapsToDateTime()
-
isZeroBased
boolean isZeroBased()Tests if this division counts from zero.- Returns:
trueif this division counts from zero
-
getSubdivisions
CalendarDivision[] getSubdivisions()Gets the child divisions.- Returns:
- the child divisions (the recursion), or
null
-
getNamedElements
CalendarDivisionElement[] getNamedElements()Gets the instances of this division.- Returns:
- the instances of this division (the nametier)
-
leaps
boolean leaps()Tests if leaping is reckoned at this division.- Returns:
trueif leaping is reckoned at this division
-
isLeapingCyclic
boolean isLeapingCyclic()Tests if leaping follows a fixed cycle pattern.- Returns:
trueif leap years follow a fixed cycle pattern
-
getCyclicLeapingPattern
long[] getCyclicLeapingPattern()Gets the cyclic leaping pattern.- Returns:
- the leaping positions within the cycle; valid when cyclic
-
getCyclicLeapingDuration
long getCyclicLeapingDuration()Gets the cycle modulus.- Returns:
- the cycle modulus; valid when cyclic
-
getCyclicLeapingStart
long getCyclicLeapingStart()Gets the cyclic leaping start.- Returns:
- the value at cycle position 1; valid when cyclic
-
isLeapingCalculated
boolean isLeapingCalculated()Tests if leaping is a calculated rule.- Returns:
trueif leap years are a calculated rule
-
getLeapingRule
LeapingRule getLeapingRule()Gets the leap calculation rule.- Returns:
- the leap calculation rule; valid when calculated
-
isLeapingAstronomical
boolean isLeapingAstronomical()Tests if leaping is predicted astronomically.- Returns:
trueif leap years are predicted astronomically
-
getLeapEphemerisRule
LeapingRule getLeapEphemerisRule()Gets the ephemeris rule.- Returns:
- the ephemeris rule; valid when astronomical
-