10 |
|
* A Collection designed for holding elements prior to processing. |
11 |
|
* Besides basic {@link Collection} operations, queues provide |
12 |
|
* additional insertion, extraction, and inspection operations. |
13 |
< |
* |
13 |
> |
0 * |
14 |
|
* <p>Queues typically, but do not necessarily, order elements in a |
15 |
|
* FIFO (first-in-first-out) manner. Among the exceptions are |
16 |
|
* priority queues, which order elements according to a supplied |
30 |
|
* Exactly which element is removed from the queue is a function |
31 |
|
* of the queue's ordering policy, which differs from implementation |
32 |
|
* to implementation. Possible orderings include (but are not limited |
33 |
< |
* to) first-in-first-out (FIFO), element priority, and arbitrary. |
33 |
> |
* to) first-in-first-out (FIFO), last-in-first-out (LIFO), element priority, and arbitrary. |
34 |
|
* The <tt>remove()</tt> and <tt>poll()</tt> methods differ only in their |
35 |
|
* behavior when the queue is empty: the <tt>remove()</tt> method throws an |
36 |
|
* exception, while the <tt>poll()</tt> method returns <tt>null</tt>. |
46 |
|
* extends this interface. |
47 |
|
* |
48 |
|
* <p><tt>Queue</tt> implementations generally do not allow insertion of |
49 |
< |
* <tt>null</tt> elements. Even in the few implementations that permit it, |
50 |
< |
* it is a bad idea, as <tt>null</tt> is also used as a special return value |
49 |
> |
* <tt>null</tt> elements, although some implementations, such as |
50 |
> |
* {@link LinkedList}, do not prohibit insertion of <tt>null</tt>. |
51 |
> |
* Even in the implementations that permit it, <tt>null</tt> should not be inserted into |
52 |
> |
* a <tt>Queue</tt>, as <tt>null</tt> is also used as a special return value |
53 |
|
* by the <tt>poll</tt> method to indicate that the queue contains no |
54 |
|
* elements. |
55 |
|
* |
60 |
|
* @see Collection |
61 |
|
* @see LinkedList |
62 |
|
* @see PriorityQueue |
63 |
< |
* @see LinkedQueue |
63 |
> |
* @see java.util.concurrent.LinkedQueue |
64 |
|
* @see java.util.concurrent.BlockingQueue |
65 |
|
* @see java.util.concurrent.ArrayBlockingQueue |
66 |
|
* @see java.util.concurrent.LinkedBlockingQueue |