Type Parameters:
E - the type of elements held in this queue
All Implemented Interfaces:
Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>

  • Constructor Summary

    Constructors

    Creates a new DelayQueue that is initially empty.

    Creates a DelayQueue initially containing the elements of the given collection of Delayed instances.

  • Method Summary

    boolean

    add(E e)

    Inserts the specified element into this delay queue.

    void

    clear()

    Atomically removes all of the elements from this delay queue.

    int

    Removes all available elements from this queue and adds them to the given collection.

    int

    Removes at most the given number of available elements from this queue and adds them to the given collection.

    iterator()

    Returns an iterator over all the elements (both expired and unexpired) in this queue.

    boolean

    offer(E e)

    Inserts the specified element into this delay queue.

    boolean

    Inserts the specified element into this delay queue.

    peek()

    Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.

    poll()

    Retrieves and removes the expired head of this queue, or returns null if this queue has no expired elements.

    Retrieves and removes the expired head of this queue, waiting if necessary until an expired element is available on this queue, or the specified wait time expires.

    void

    put(E e)

    Inserts the specified element into this delay queue.

    int

    Always returns Integer.MAX_VALUE because a DelayQueue is not capacity constrained.

    remove()

    Retrieves and removes the expired head of this queue, or throws an exception if this queue has no expired elements.

    boolean

    Removes a single instance of the specified element from this queue, if it is present, whether or not it has expired.

    int

    size()

    Returns the number of elements in this collection.

    take()

    Retrieves and removes the expired head of this queue, waiting if necessary until an expired element is available on this queue.

    toArray()

    Returns an array containing all of the elements in this queue.

    <T> T[]

    toArray(T[] a)

    Returns an array containing all of the elements in this queue; the runtime type of the returned array is that of the specified array.

  • Constructor Details

    • DelayQueue

    • DelayQueue

  • Method Details

    • add

    • offer

    • put

    • offer

    • poll

    • take

    • poll

    • remove

    • peek

    • size

    • drainTo

    • drainTo

    • clear

    • remainingCapacity

    • toArray

    • toArray

    • remove

    • iterator