Class Interval

    • Method Detail

      • of

        public static Interval of​(Instant start,
                                  Instant end)
        Retrieve an interval in between start and end instants.
        Parameters:
        start - Start instant
        end - End instant
        Returns:
        Interval [start, end)
      • of

        public static Interval of​(long start,
                                  long end)
        Retrieve an interval in between start and end expressed as millis from epoch.
        Parameters:
        start - Start time (epoch millis)
        end - End time (epoch millis)
        Returns:
        Interval [start, end)
      • contains

        public boolean contains​(long instant)
        Test if this interval contains the given instant.
        Parameters:
        instant - Instant (epoch millis)
        Returns:
        Test result
      • contains

        public boolean contains​(Interval interval)
        Test if this interval contains the given interval.
        Parameters:
        interval - Interval to test
        Returns:
        Test result
      • isAfter

        public boolean isAfter​(long instant)
      • isAfter

        public boolean isAfter​(Interval interval)
      • isBefore

        public boolean isBefore​(long instant)
      • isBefore

        public boolean isBefore​(Interval interval)
      • overlaps

        public boolean overlaps​(Interval interval)
      • toDurationMillis

        public long toDurationMillis()