java.lang.Object java.util.AbstractCollection<E> java.util.AbstractQueue
Direct Known Subclasses:
SynchronousQueue, AsLIFOQueue, PriorityQueue, PriorityBlockingQueue, LinkedBlockingQueue, DelayedWorkQueue, LinkedTransferQueue, ConcurrentLinkedQueue, ArrayBlockingQueue, LinkedBlockingDeque, DelayQueue
A Queue implementation that extends this class must minimally define a method Queue#offer which does not permit insertion of null elements, along with methods Queue#peek , Queue#poll , Collection#size , and Collection#iterator . Typically, additional methods will be overridden as well. If these requirements cannot be met, consider instead subclassing AbstractCollection .
This class is a member of the Java Collections Framework.
- the type of elements held in this collection
|Method from java.util.AbstractQueue Summary:|
|add, addAll, clear, element, remove|
|Methods from java.util.AbstractCollection:|
|add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString|
|Methods from java.lang.Object:|
|clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait|
|Method from java.util.AbstractQueue Detail:|
public boolean add(E e)
This implementation returns true if offer succeeds, else throws an IllegalStateException.
public boolean addAll(Collection<? extends E> c)
This implementation iterates over the specified collection, and adds each element returned by the iterator to this queue, in turn. A runtime exception encountered while trying to add an element (including, in particular, a null element) may result in only some of the elements having been successfully added when the associated exception is thrown.
public void clear()
This implementation repeatedly invokes poll until it returns null.
public E element()
This implementation returns the result of peek unless the queue is empty.
public E remove()
This implementation returns the result of poll unless the queue is empty.