Interface CalendarSystem<D>

Type Parameters:
D - generic type of calendar date (subtype of Calendrical or CalendarVariant)

public interface CalendarSystem<D>

Represents a calendar system which can map a calendar date to a day number corresponding to the count of days elapsed since UTC epoch [1972-01-01].

Note: All implementations must be immutable.

Author:
Meno Hochschild
See Also:
Calendrical, CalendarVariant, EpochDays
  • Method Summary

    Modifier and Type
    Method
    Description
    Yields an enumeration of valid eras in ascending order.
    long
    Gets the maximum day number as count of days since the introduction of UTC [1972-01-01].
    long
    Gets the minimum day number as count of days since the introduction of UTC [1972-01-01].
    transform​(long utcDays)
    Transforms given day number to a calendar date on the local time line at the reference time of noon.
    long
    transform​(D date)
    Transforms given calendar date to a day number on the local time line at the reference time of noon.
  • Method Details

    • transform

      D transform(long utcDays)

      Transforms given day number to a calendar date on the local time line at the reference time of noon.

      Parameters:
      utcDays - count of days since UTC epoch [1972-01-01]
      Returns:
      new calendar date
      Throws:
      IllegalArgumentException - if the argument is out of range
    • transform

      long transform(D date)

      Transforms given calendar date to a day number on the local time line at the reference time of noon.

      Parameters:
      date - calendar date to be transformed
      Returns:
      count of days since UTC epoch [1972-01-01]
      Throws:
      IllegalArgumentException - if the argument is not consistent with this calendar system
    • getMinimumSinceUTC

      long getMinimumSinceUTC()

      Gets the minimum day number as count of days since the introduction of UTC [1972-01-01].

      Returns:
      smallest count of days relative to UTC epoch [1972-01-01]
      See Also:
      getMaximumSinceUTC()
    • getMaximumSinceUTC

      long getMaximumSinceUTC()

      Gets the maximum day number as count of days since the introduction of UTC [1972-01-01].

      Returns:
      largest count of days relative to UTC epoch [1972-01-01]
      See Also:
      getMinimumSinceUTC()
    • getEras

      List<CalendarEra> getEras()

      Yields an enumeration of valid eras in ascending order.

      All ISO-systems only yield an empty list. A gregorian calendar defines the eras BC and AD related to Jesu birth however.

      Returns:
      unmodifiable list of eras (maybe empty)