Class TimeWindow

    • Constructor Detail

      • TimeWindow

        public TimeWindow​(long startMs,
                          long endMs)
                   throws IllegalArgumentException
        Create a new window for the given start time (inclusive) and end time (exclusive).
        Parameters:
        startMs - the start timestamp of the window (inclusive)
        endMs - the end timestamp of the window (exclusive)
        Throws:
        IllegalArgumentException - if startMs is negative or if endMs is smaller than or equal to startMs
    • Method Detail

      • overlap

        public boolean overlap​(Window other)
                        throws IllegalArgumentException
        Check if the given window overlaps with this window.
        Specified by:
        overlap in class Window
        Parameters:
        other - another window
        Returns:
        true if other overlaps with this window—false otherwise
        Throws:
        IllegalArgumentException - if the other window has a different type than this window