Class TimeRange<T extends Comparable<T> & Temporal>

java.lang.Object
io.deephaven.time.calendar.TimeRange<T>
Type Parameters:
T - time type

public class TimeRange<T extends Comparable<T> & Temporal> extends Object
A range of time.
  • Method Details

    • start

      public T start()
      Start of the range.
      Returns:
      start of the range
    • end

      public T end()
      End of the range.
      Returns:
      End of the range
    • isInclusiveEnd

      public boolean isInclusiveEnd()
      Is the end time inclusive?
      Returns:
      is the end time inclusive?
    • nanos

      public long nanos()
      Length of the range in nanoseconds.
      Returns:
      length of the range in nanoseconds
    • duration

      public Duration duration()
      Duration of the range.
      Returns:
      duration of the range
    • contains

      public boolean contains(T time)
      Determines if the specified time is within the time range.
      Parameters:
      time - time.
      Returns:
      true if the time is in this range; otherwise, false.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toInstant

      public static TimeRange<Instant> toInstant(TimeRange<LocalTime> p, LocalDate date, ZoneId timeZone)
      Converts a time range in local time to a specific date and time zone.
      Parameters:
      p - time range in local time
      date - date for the new time range
      timeZone - time zone for the new time range
      Returns:
      new time range in the specified date and time zone