Interface Temporal<C>

Type Parameters:
C - generic temporal type for pure temporal comparison purposes
All Known Subinterfaces:
CalendarDate
All Known Implementing Classes:
AnnualDate, BadiCalendar, CalendarVariant, Calendrical, ChineseCalendar, CopticCalendar, EastAsianCalendar, EthiopianCalendar, EthiopianTime, FrenchRepublicanCalendar, HebrewCalendar, HebrewTime, HijriCalendar, HinduCalendar, HistoricCalendar, IndianCalendar, JapaneseCalendar, JucheCalendar, JulianCalendar, KoreanCalendar, MinguoCalendar, Moment, PersianCalendar, PlainDate, PlainTime, PlainTimestamp, ThaiSolarCalendar, VietnameseCalendar

public interface Temporal<C>

Represents an object which can be sorted on a time axis in a temporal-only way.

Author:
Meno Hochschild
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isAfter​(C temporal)
    Queries if this object is after given object on a timeline.
    default boolean
    isAfterAll​(C... temporals)
    Queries if this object is after all given objects on a timeline.
    default boolean
    isAfterOrEqual​(C temporal)
    Queries if this object is after or simultaneous to given parameter.
    boolean
    isBefore​(C temporal)
    Queries if this object is before given object on a timeline.
    default boolean
    isBeforeAll​(C... temporals)
    Queries if this object is before all given objects on a timeline.
    default boolean
    isBeforeOrEqual​(C temporal)
    Queries if this object is before or simultaneous to given parameter.
    boolean
    isSimultaneous​(C temporal)
    Queries if this object and given object have the same position on the time axis.
  • Method Details

    • isAfter

      boolean isAfter(C temporal)

      Queries if this object is after given object on a timeline.

      Parameters:
      temporal - object this instance is compared to
      Returns:
      true if this instance is temporally after temporal else false
    • isBefore

      boolean isBefore(C temporal)

      Queries if this object is before given object on a timeline.

      Parameters:
      temporal - object this instance is compared to
      Returns:
      true if this instance is temporally before temporal else false
    • isSimultaneous

      boolean isSimultaneous(C temporal)

      Queries if this object and given object have the same position on the time axis.

      Is equivalent to !isAfter(temporal) && !isBefore(temporal). This method differs from the Object-method equals() such that first the comparison type must be a temporal one and second that only temporal-only state will be considered.

      Parameters:
      temporal - object this instance is compared to
      Returns:
      true if this instance is temporally equal to temporal else false
    • isAfterOrEqual

      default boolean isAfterOrEqual(C temporal)

      Queries if this object is after or simultaneous to given parameter.

      Parameters:
      temporal - object this instance is compared to
      Returns:
      true if this instance is temporally after or equal to temporal else false
      Since:
      5.0
    • isBeforeOrEqual

      default boolean isBeforeOrEqual(C temporal)

      Queries if this object is before or simultaneous to given parameter.

      Parameters:
      temporal - object this instance is compared to
      Returns:
      true if this instance is temporally before or equal to temporal else false
      Since:
      5.0
    • isAfterAll

      default boolean isAfterAll(C... temporals)

      Queries if this object is after all given objects on a timeline.

      Note: This method should be considered as final and not be overridden.

      Parameters:
      temporals - array of objects this instance is compared to
      Returns:
      true if this instance is temporally after every object in temporals else false
    • isBeforeAll

      default boolean isBeforeAll(C... temporals)

      Queries if this object is before all given objects on a timeline.

      Note: This method should be considered as final and not be overridden.

      Parameters:
      temporals - array of objects this instance is compared to
      Returns:
      true if this instance is temporally before every object in temporals else false