1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166x; // XXX This belongs in java.util!!! XXX |
8 |
|
import java.util.concurrent.*; // XXX This import goes away XXX |
9 |
< |
import java.util.*; |
9 |
> |
import java.util.*; |
10 |
|
|
11 |
|
/** |
12 |
|
* A {@link Deque} that additionally supports operations that wait for |
32 |
|
* <td>{@link #putFirst putFirst(e)}</td> |
33 |
|
* <td>{@link #offerFirst(Object, long, TimeUnit) offerFirst(e, time, unit)}</td> |
34 |
|
* <td>{@link #putLast putLast(e)}</td> |
35 |
< |
* <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td> |
35 |
> |
* <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td> |
36 |
|
* </tr> |
37 |
|
* <tr> |
38 |
|
* <td><b>Remove</b></td> |
187 |
|
/** |
188 |
|
* Adds the specified element as the last element of this deque, |
189 |
|
* waiting if necessary for space to become available. This |
190 |
< |
* method is equivalent to to putLast |
190 |
> |
* method is equivalent to putLast |
191 |
|
* @param o the element to add |
192 |
|
* @throws InterruptedException if interrupted while waiting. |
193 |
|
* @throws NullPointerException if the specified element is <tt>null</tt>. |
194 |
|
*/ |
195 |
|
void put(E o) throws InterruptedException; |
196 |
|
|
197 |
< |
/** |
197 |
> |
/** |
198 |
|
* Inserts the specified element as the lest element of this |
199 |
|
* deque, if possible. When using deques that may impose |
200 |
|
* insertion restrictions (for example capacity bounds), method |
201 |
|
* <tt>offer</tt> is generally preferable to method {@link |
202 |
|
* Collection#add}, which can fail to insert an element only by |
203 |
< |
* throwing an exception. This method is equivalent to to |
203 |
> |
* throwing an exception. This method is equivalent to |
204 |
|
* offerLast |
205 |
|
* |
206 |
|
* @param o the element to add. |
214 |
|
/** |
215 |
|
* Retrieves and removes the first element of this deque, waiting |
216 |
|
* if no elements are present on this deque. |
217 |
< |
* This method is equivalent to to takeFirst |
217 |
> |
* This method is equivalent to takeFirst |
218 |
|
* @return the head of this deque |
219 |
|
* @throws InterruptedException if interrupted while waiting. |
220 |
|
*/ |
223 |
|
/** |
224 |
|
* Retrieves and removes the first element of this deque, waiting |
225 |
|
* if necessary up to the specified wait time if no elements are |
226 |
< |
* present on this deque. This method is equivalent to to |
226 |
> |
* present on this deque. This method is equivalent to |
227 |
|
* pollFirst |
228 |
|
* @param timeout how long to wait before giving up, in units of |
229 |
|
* <tt>unit</tt> |