An unbounded {@linkplain BlockingQueue blocking queue} of{@code Delayed} elements, in which an element can only be takenwhen its delay has expired. The
head of the queue is that {@code Delayed} element whose delay expired furthest in thepast. If no delay has expired there is no head and {@code poll}will return {@code null}. Expiration occurs when an element's {@code getDelay(TimeUnit.NANOSECONDS)} method returns a value lessthan or equal to zero. Even though unexpired elements cannot be removed using {@code take} or {@code poll}, they are otherwise treated as normal elements. For example, the {@code size} methodreturns the count of both expired and unexpired elements. This queue does not permit null elements.
This class and its iterator implement all of the optional methods of the {@link Collection} and {@link Iterator} interfaces. The Iterator provided in method {@link #iterator()} is not guaranteed to traverse the elements ofthe DelayQueue in any particular order.
This class is a member of the Java Collections Framework.
@since 1.5
@author Doug Lea
@param < E> the type of elements held in this collection