Interface TimeInterval


public interface TimeInterval
Interface representing a closed time interval i.e. [a, b], possibly of infinite length.
Since:
13.1
Author:
Romain Serra
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Method returning true if and only if input (also a closed time interval) contains the instance.
    default boolean
    contains(TimeStamped timeStamped)
    Method returning true if and only if the dated input is contained within the closed interval.
    default double
    Computes the interval length in seconds.
    Getter for the right end of the interval.
    Getter for the left end of the interval.
    default boolean
    Method returning true if and only if input (also a closed time interval) intersects the instance.
    of(AbsoluteDate date, double duration)
    Create instance from two dates in arbitrary order.
    of(AbsoluteDate date, AbsoluteDate otherDate)
    Create instance from two dates in arbitrary order.
  • Method Details

    • getStartDate

      AbsoluteDate getStartDate()
      Getter for the left end of the interval.
      Returns:
      left end
    • getEndDate

      AbsoluteDate getEndDate()
      Getter for the right end of the interval.
      Returns:
      right end
    • duration

      default double duration()
      Computes the interval length in seconds.
      Returns:
      duration
    • contains

      default boolean contains(TimeStamped timeStamped)
      Method returning true if and only if the dated input is contained within the closed interval.
      Parameters:
      timeStamped - time stamped object
      Returns:
      boolean on inclusion
    • contains

      default boolean contains(TimeInterval interval)
      Method returning true if and only if input (also a closed time interval) contains the instance.
      Parameters:
      interval - time interval
      Returns:
      boolean on inclusion
    • intersects

      default boolean intersects(TimeInterval interval)
      Method returning true if and only if input (also a closed time interval) intersects the instance.
      Parameters:
      interval - time interval
      Returns:
      boolean on intersection
    • of

      static TimeInterval of(AbsoluteDate date, AbsoluteDate otherDate)
      Create instance from two dates in arbitrary order.
      Parameters:
      date - date
      otherDate - other date
      Returns:
      time interval
    • of

      static TimeInterval of(AbsoluteDate date, double duration)
      Create instance from two dates in arbitrary order.
      Parameters:
      date - start (or end) date
      duration - duration, in seconds (if positive, time interval is from date to date + duration, if negative, the time interval will be from date - duration to date)
      Returns:
      time interval
      Since:
      14.0