27 |
|
* <table class="plain"> |
28 |
|
* <caption>Summary of BlockingDeque methods</caption> |
29 |
|
* <tr> |
30 |
< |
* <td style="text-align:center" COLSPAN = 5> <b>First Element (Head)</b></td> |
30 |
> |
* <th id="First" colspan="5"> First Element (Head)</th> |
31 |
|
* </tr> |
32 |
|
* <tr> |
33 |
|
* <td></td> |
34 |
< |
* <td style="text-align:center"><em>Throws exception</em></td> |
35 |
< |
* <td style="text-align:center"><em>Special value</em></td> |
36 |
< |
* <td style="text-align:center"><em>Blocks</em></td> |
37 |
< |
* <td style="text-align:center"><em>Times out</em></td> |
34 |
> |
* <th id="FThrow" style="font-weight:normal; font-style: italic">Throws exception</th> |
35 |
> |
* <th id="FValue" style="font-weight:normal; font-style: italic">Special value</th> |
36 |
> |
* <th id="FBlock" style="font-weight:normal; font-style: italic">Blocks</th> |
37 |
> |
* <th id="FTimes" style="font-weight:normal; font-style: italic">Times out</th> |
38 |
|
* </tr> |
39 |
|
* <tr> |
40 |
< |
* <td><b>Insert</b></td> |
41 |
< |
* <td>{@link #addFirst(Object) addFirst(e)}</td> |
42 |
< |
* <td>{@link #offerFirst(Object) offerFirst(e)}</td> |
43 |
< |
* <td>{@link #putFirst(Object) putFirst(e)}</td> |
44 |
< |
* <td>{@link #offerFirst(Object, long, TimeUnit) offerFirst(e, time, unit)}</td> |
40 |
> |
* <th id="FInsert" style="text-align:left">Insert</th> |
41 |
> |
* <td headers="First FInsert FThrow">{@link #addFirst(Object) addFirst(e)}</td> |
42 |
> |
* <td headers="First FInsert FValue">{@link #offerFirst(Object) offerFirst(e)}</td> |
43 |
> |
* <td headers="First FInsert FBlock">{@link #putFirst(Object) putFirst(e)}</td> |
44 |
> |
* <td headers="First FInsert FTimes">{@link #offerFirst(Object, long, TimeUnit) offerFirst(e, time, unit)}</td> |
45 |
|
* </tr> |
46 |
|
* <tr> |
47 |
< |
* <td><b>Remove</b></td> |
48 |
< |
* <td>{@link #removeFirst() removeFirst()}</td> |
49 |
< |
* <td>{@link #pollFirst() pollFirst()}</td> |
50 |
< |
* <td>{@link #takeFirst() takeFirst()}</td> |
51 |
< |
* <td>{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td> |
47 |
> |
* <th id="FRemove" style="text-align:left">Remove</th> |
48 |
> |
* <td headers="First FRemove FThrow">{@link #removeFirst() removeFirst()}</td> |
49 |
> |
* <td headers="First FRemove FValue">{@link #pollFirst() pollFirst()}</td> |
50 |
> |
* <td headers="First FRemove FBlock">{@link #takeFirst() takeFirst()}</td> |
51 |
> |
* <td headers="First FRemove FTimes">{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td> |
52 |
|
* </tr> |
53 |
|
* <tr> |
54 |
< |
* <td><b>Examine</b></td> |
55 |
< |
* <td>{@link #getFirst() getFirst()}</td> |
56 |
< |
* <td>{@link #peekFirst() peekFirst()}</td> |
57 |
< |
* <td><em>not applicable</em></td> |
58 |
< |
* <td><em>not applicable</em></td> |
54 |
> |
* <th id="FExamine" style="text-align:left">Examine</th> |
55 |
> |
* <td headers="First FExamine FThrow">{@link #getFirst() getFirst()}</td> |
56 |
> |
* <td headers="First FExamine FValue">{@link #peekFirst() peekFirst()}</td> |
57 |
> |
* <td headers="First FExamine FBlock" style="font-style:italic">not applicable</td> |
58 |
> |
* <td headers="First FExamine FTimes" style="font-style:italic">not applicable</td> |
59 |
|
* </tr> |
60 |
|
* <tr> |
61 |
< |
* <td style="text-align:center" COLSPAN = 5> <b>Last Element (Tail)</b></td> |
61 |
> |
* <th id="Last" colspan="5"> Last Element (Tail)</th> |
62 |
|
* </tr> |
63 |
|
* <tr> |
64 |
|
* <td></td> |
65 |
< |
* <td style="text-align:center"><em>Throws exception</em></td> |
66 |
< |
* <td style="text-align:center"><em>Special value</em></td> |
67 |
< |
* <td style="text-align:center"><em>Blocks</em></td> |
68 |
< |
* <td style="text-align:center"><em>Times out</em></td> |
69 |
< |
* </tr> |
70 |
< |
* <tr> |
71 |
< |
* <td><b>Insert</b></td> |
72 |
< |
* <td>{@link #addLast(Object) addLast(e)}</td> |
73 |
< |
* <td>{@link #offerLast(Object) offerLast(e)}</td> |
74 |
< |
* <td>{@link #putLast(Object) putLast(e)}</td> |
75 |
< |
* <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td> |
76 |
< |
* </tr> |
77 |
< |
* <tr> |
78 |
< |
* <td><b>Remove</b></td> |
79 |
< |
* <td>{@link #removeLast() removeLast()}</td> |
80 |
< |
* <td>{@link #pollLast() pollLast()}</td> |
81 |
< |
* <td>{@link #takeLast() takeLast()}</td> |
82 |
< |
* <td>{@link #pollLast(long, TimeUnit) pollLast(time, unit)}</td> |
83 |
< |
* </tr> |
84 |
< |
* <tr> |
85 |
< |
* <td><b>Examine</b></td> |
86 |
< |
* <td>{@link #getLast() getLast()}</td> |
87 |
< |
* <td>{@link #peekLast() peekLast()}</td> |
88 |
< |
* <td><em>not applicable</em></td> |
89 |
< |
* <td><em>not applicable</em></td> |
65 |
> |
* <th id="LThrow" style="font-weight:normal; font-style: italic">Throws exception</th> |
66 |
> |
* <th id="LValue" style="font-weight:normal; font-style: italic">Special value</th> |
67 |
> |
* <th id="LBlock" style="font-weight:normal; font-style: italic">Blocks</th> |
68 |
> |
* <th id="LTimes" style="font-weight:normal; font-style: italic">Times out</th> |
69 |
> |
* </tr> |
70 |
> |
* <tr> |
71 |
> |
* <th id="LInsert" style="text-align:left">Insert</th> |
72 |
> |
* <td headers="Last LInsert LThrow">{@link #addLast(Object) addLast(e)}</td> |
73 |
> |
* <td headers="Last LInsert LValue">{@link #offerLast(Object) offerLast(e)}</td> |
74 |
> |
* <td headers="Last LInsert LBlock">{@link #putLast(Object) putLast(e)}</td> |
75 |
> |
* <td headers="Last LInsert LTimes">{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td> |
76 |
> |
* </tr> |
77 |
> |
* <tr> |
78 |
> |
* <th id="LRemove" style="text-align:left">Remove</th> |
79 |
> |
* <td headers="Last LRemove LThrow">{@link #removeLast() removeLast()}</td> |
80 |
> |
* <td headers="Last LRemove LValue">{@link #pollLast() pollLast()}</td> |
81 |
> |
* <td headers="Last LRemove LBlock">{@link #takeLast() takeLast()}</td> |
82 |
> |
* <td headers="Last LRemove LTimes">{@link #pollLast(long, TimeUnit) pollLast(time, unit)}</td> |
83 |
> |
* </tr> |
84 |
> |
* <tr> |
85 |
> |
* <th id="LExamine" style="text-align:left">Examine</th> |
86 |
> |
* <td headers="Last LExamine LThrow">{@link #getLast() getLast()}</td> |
87 |
> |
* <td headers="Last LExamine LValue">{@link #peekLast() peekLast()}</td> |
88 |
> |
* <td headers="Last LExamine LBlock" style="font-style:italic">not applicable</td> |
89 |
> |
* <td headers="Last LExamine LTimes" style="font-style:italic">not applicable</td> |
90 |
|
* </tr> |
91 |
|
* </table> |
92 |
|
* |
102 |
|
* <table class="plain"> |
103 |
|
* <caption>Comparison of BlockingQueue and BlockingDeque methods</caption> |
104 |
|
* <tr> |
105 |
< |
* <td style="text-align:center"> <b>{@code BlockingQueue} Method</b></td> |
106 |
< |
* <td style="text-align:center"> <b>Equivalent {@code BlockingDeque} Method</b></td> |
107 |
< |
* </tr> |
108 |
< |
* <tr> |
109 |
< |
* <td style="text-align:center" COLSPAN = 2> <b>Insert</b></td> |
110 |
< |
* </tr> |
111 |
< |
* <tr> |
112 |
< |
* <td>{@link #add(Object) add(e)}</td> |
113 |
< |
* <td>{@link #addLast(Object) addLast(e)}</td> |
114 |
< |
* </tr> |
115 |
< |
* <tr> |
116 |
< |
* <td>{@link #offer(Object) offer(e)}</td> |
117 |
< |
* <td>{@link #offerLast(Object) offerLast(e)}</td> |
105 |
> |
* <td></td> |
106 |
> |
* <th id="BQueue"> {@code BlockingQueue} Method</th> |
107 |
> |
* <th id="BDeque"> Equivalent {@code BlockingDeque} Method</th> |
108 |
|
* </tr> |
109 |
|
* <tr> |
110 |
< |
* <td>{@link #put(Object) put(e)}</td> |
111 |
< |
* <td>{@link #putLast(Object) putLast(e)}</td> |
110 |
> |
* <th id="Insert" rowspan="4" style="text-align:left; vertical-align:top">Insert</th> |
111 |
> |
* <th id="add" style="font-weight:normal; text-align:left">{@link #add(Object) add(e)}</th> |
112 |
> |
* <td headers="Insert BDeque add">{@link #addLast(Object) addLast(e)}</td> |
113 |
|
* </tr> |
114 |
|
* <tr> |
115 |
< |
* <td>{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</td> |
116 |
< |
* <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td> |
115 |
> |
* <th id="offer1" style="font-weight:normal; text-align:left">{@link #offer(Object) offer(e)}</th> |
116 |
> |
* <td headers="Insert BDeque offer1">{@link #offerLast(Object) offerLast(e)}</td> |
117 |
|
* </tr> |
118 |
|
* <tr> |
119 |
< |
* <td style="text-align:center" COLSPAN = 2> <b>Remove</b></td> |
119 |
> |
* <th id="put" style="font-weight:normal; text-align:left">{@link #put(Object) put(e)}</th> |
120 |
> |
* <td headers="Insert BDeque put">{@link #putLast(Object) putLast(e)}</td> |
121 |
|
* </tr> |
122 |
|
* <tr> |
123 |
< |
* <td>{@link #remove() remove()}</td> |
124 |
< |
* <td>{@link #removeFirst() removeFirst()}</td> |
123 |
> |
* <th id="offer2" style="font-weight:normal; text-align:left">{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</th> |
124 |
> |
* <td headers="Insert BDeque offer2">{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td> |
125 |
|
* </tr> |
126 |
|
* <tr> |
127 |
< |
* <td>{@link #poll() poll()}</td> |
128 |
< |
* <td>{@link #pollFirst() pollFirst()}</td> |
127 |
> |
* <th id="Remove" rowspan="4" style="text-align:left; vertical-align:top">Remove</th> |
128 |
> |
* <th id="remove" style="font-weight:normal; text-align:left">{@link #remove() remove()}</th> |
129 |
> |
* <td headers="Remove BDeque remove">{@link #removeFirst() removeFirst()}</td> |
130 |
|
* </tr> |
131 |
|
* <tr> |
132 |
< |
* <td>{@link #take() take()}</td> |
133 |
< |
* <td>{@link #takeFirst() takeFirst()}</td> |
132 |
> |
* <th id="poll1" style="font-weight:normal; text-align:left">{@link #poll() poll()}</th> |
133 |
> |
* <td headers="Remove BDeque poll1">{@link #pollFirst() pollFirst()}</td> |
134 |
|
* </tr> |
135 |
|
* <tr> |
136 |
< |
* <td>{@link #poll(long, TimeUnit) poll(time, unit)}</td> |
137 |
< |
* <td>{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td> |
136 |
> |
* <th id="take" style="font-weight:normal; text-align:left">{@link #take() take()}</th> |
137 |
> |
* <td headers="Remove BDeque take">{@link #takeFirst() takeFirst()}</td> |
138 |
|
* </tr> |
139 |
|
* <tr> |
140 |
< |
* <td style="text-align:center" COLSPAN = 2> <b>Examine</b></td> |
140 |
> |
* <th id="poll2" style="font-weight:normal; text-align:left">{@link #poll(long, TimeUnit) poll(time, unit)}</th> |
141 |
> |
* <td headers="Remove BDeque poll2">{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td> |
142 |
|
* </tr> |
143 |
|
* <tr> |
144 |
< |
* <td>{@link #element() element()}</td> |
145 |
< |
* <td>{@link #getFirst() getFirst()}</td> |
144 |
> |
* <th id="Examine" rowspan="2" style="text-align:left; vertical-align:top">Examine</th> |
145 |
> |
* <th id="element" style="font-weight:normal; text-align:left">{@link #element() element()}</th> |
146 |
> |
* <td headers="Examine BDeque element">{@link #getFirst() getFirst()}</td> |
147 |
|
* </tr> |
148 |
|
* <tr> |
149 |
< |
* <td>{@link #peek() peek()}</td> |
150 |
< |
* <td>{@link #peekFirst() peekFirst()}</td> |
149 |
> |
* <th id="peek" style="font-weight:normal; text-align:left">{@link #peek() peek()}</th> |
150 |
> |
* <td headers="Examine BDeque peek">{@link #peekFirst() peekFirst()}</td> |
151 |
|
* </tr> |
152 |
|
* </table> |
153 |
|
* |