API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent. DelayQueue View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractQueue
              DelayQueue
Implements
 BlockingQueue
Subclasses
Description
public class DelayQueue
  An unbounded blocking queue of Delayed elements, in which an element can only be taken when its delay has expired.
See also:   
Constructors
public DelayQueue ()
Creates a new DelayQueue that is initially empty.
public DelayQueue (Collection<Delayed> c)
  Creates a DelayQueue initially containing the elements of the given collection of Delayed instances.
Methods
Hide/Show inherited methods
public boolean add ( E e) [Overrides AbstractQueue] [Specified in BlockingQueue]
  Inserts the specified element into this delay queue.
public boolean addAll (Collection<Object> c) [Inherited From AbstractQueue]
  Adds all of the elements in the specified collection to this queue.
public void clear () [Overrides AbstractQueue]
  Atomically removes all of the elements from this delay queue.
public boolean contains (Object o) [Inherited From AbstractCollection]
  Returns true if this collection contains the specified element.
public boolean containsAll (Collection<Object> c) [Inherited From AbstractCollection]
  Returns true if this collection contains all of the elements in the specified collection.
public int drainTo (Collection<Object> c) [Specified in BlockingQueue]
 
public int drainTo (Collection<Object> c, int maxElements) [Specified in BlockingQueue]
 
public E element () [Inherited From AbstractQueue]
  Retrieves, but does not remove, the head of this queue.
public boolean isEmpty () [Inherited From AbstractCollection]
  Returns true if this collection contains no elements.
public Iterator< E> iterator () [Specified in AbstractCollection]
  Returns an iterator over all the elements (both expired and unexpired) in this queue.
public boolean offer ( E e) [Specified in BlockingQueue]
  Inserts the specified element into this delay queue.
public boolean offer ( E e, long timeout, TimeUnit unit) [Specified in BlockingQueue]
  Inserts the specified element into this delay queue.
public E peek ()
  Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.
public E poll ()
  Retrieves and removes the head of this queue, or returns null if this queue has no elements with an expired delay.
public E poll (long timeout, TimeUnit unit) throws InterruptedException [Specified in BlockingQueue]
  Retrieves and removes the head of this queue, waiting if necessary until an element with an expired delay is available on this queue, or the specified wait time expires.
public void put ( E e) [Specified in BlockingQueue]
  Inserts the specified element into this delay queue.
public int remainingCapacity () [Specified in BlockingQueue]
  Always returns Integer.MAX_VALUE because a DelayQueue is not capacity constrained.
public E remove () [Inherited From AbstractQueue]
  Retrieves and removes the head of this queue.
public boolean remove (Object o) [Overrides AbstractCollection] [Specified in BlockingQueue]
Removes a single instance of the specified element from this queue, if it is present, whether or not it has expired.
public boolean removeAll (Collection<Object> c) [Inherited From AbstractCollection]
  Removes all of this collection's elements that are also contained in the specified collection (optional operation).
public boolean retainAll (Collection<Object> c) [Inherited From AbstractCollection]
  Retains only the elements in this collection that are contained in the specified collection (optional operation).
public int size () [Specified in AbstractCollection]
public E take () throws InterruptedException [Specified in BlockingQueue]
  Retrieves and removes the head of this queue, waiting if necessary until an element with an expired delay is available on this queue.
public Object toArray () [Overrides AbstractCollection]
  Returns an array containing all of the elements in this queue.
public T toArray ( T a) [Overrides AbstractCollection]
  Returns an array containing all of the elements in this queue; the runtime type of the returned array is that of the specified array.
public String toString () [Inherited From AbstractCollection]
  Returns a string representation of this collection.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar