Interface CalendarDivision

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractCalendarDivision

public interface CalendarDivision extends Serializable
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 Details

    • getName

      DisplayText getName()
      Gets the division name.
      Returns:
      the division name (e.g. "month")
    • getDescription

      DisplayText getDescription()
      Gets the division description.
      Returns:
      the division description
    • mapsToDateTime

      boolean mapsToDateTime()
      Tests if this division maps to a resolution.
      Returns:
      true if 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:
      true if 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:
      true if leaping is reckoned at this division
    • isLeapingCyclic

      boolean isLeapingCyclic()
      Tests if leaping follows a fixed cycle pattern.
      Returns:
      true if 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:
      true if 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:
      true if leap years are predicted astronomically
    • getLeapEphemerisRule

      LeapingRule getLeapEphemerisRule()
      Gets the ephemeris rule.
      Returns:
      the ephemeris rule; valid when astronomical