Interface TimeoutPriorityQueue

    • Method Detail

      • offer

        TimeoutExt offer​(long time,
                         TimeoutTarget target)
        Add a timeout to the queue
        Parameters:
        time - the time of the timeout
        target - the timeout target
        Returns:
        timeout when it was added to the queue, false otherwise
      • take

        TimeoutExt take()
        Take a timeout when it times out
        Returns:
        the top the queue or null if the queue is cancelled
      • poll

        TimeoutExt poll()
        Retrieves and removes the top of the queue if it times out or null if there is no such element
        Returns:
        the top the queue or null if the queue is empty
      • poll

        TimeoutExt poll​(long wait)
        Retrieves and removes the top of the queue if it times out or null if there is no such element
        Parameters:
        wait - how to long to wait in milliseconds if the queue is empty
        Returns:
        the top of the queue or null if the queue is empty
      • peek

        TimeoutExt peek()
        Retrieves but does not remove the top of the queue or null if there is no such element
        Returns:
        the top of the queue or null if the queue is empty
      • remove

        boolean remove​(TimeoutExt timeout)
        Removes the passed timeout from the queue
        Parameters:
        timeout -
        Returns:
        true when the timeout was removed
      • clear

        void clear()
        Clears the queue
      • cancel

        void cancel()
        Cancels the queue
      • size

        int size()
        Returns:
        the size of the queue