65 |
|
* |
66 |
|
* <p>This interface extends the {@link Queue} interface. When a deque is |
67 |
|
* used as a queue, FIFO (First-In-First-Out) behavior results. Elements are |
68 |
< |
* added to the end of the deque and removed from the beginning. The methods |
68 |
> |
* added at the end of the deque and removed from the beginning. The methods |
69 |
|
* inherited from the <tt>Queue</tt> interface are precisely equivalent to |
70 |
|
* <tt>Deque</tt> methods as indicated in the following table:<p> |
71 |
|
* |
176 |
|
boolean offerFirst(E e); |
177 |
|
|
178 |
|
/** |
179 |
< |
* Inserts the specified element to the end of this deque unless it would |
179 |
> |
* Inserts the specified element at the end of this deque unless it would |
180 |
|
* violate capacity restrictions. When using a capacity-restricted deque, |
181 |
|
* this method is generally preferable to method <tt>addLast</tt> which |
182 |
|
* can fail to insert an element only by throwing an exception. |
202 |
|
void addFirst(E e); |
203 |
|
|
204 |
|
/** |
205 |
< |
* Inserts the specified element to the end of this deque unless it would |
205 |
> |
* Inserts the specified element at the end of this deque unless it would |
206 |
|
* violate capacity restrictions. |
207 |
|
* |
208 |
|
* @param e the element to insert |
298 |
|
* |
299 |
|
* @param o element to be removed from this deque, if present |
300 |
|
* @return <tt>true</tt> if the deque contained the specified element |
301 |
< |
* @throws NullPointerException if the specified element is <tt>null</tt> |
301 |
> |
* @throws NullPointerException if the specified element is null and this |
302 |
> |
* deque does not permit null elements |
303 |
|
*/ |
304 |
|
boolean removeFirstOccurrence(Object o); |
305 |
|
|
312 |
|
* |
313 |
|
* @param o element to be removed from this deque, if present |
314 |
|
* @return <tt>true</tt> if the deque contained the specified element |
315 |
< |
* @throws NullPointerException if the specified element is <tt>null</tt> |
315 |
> |
* @throws NullPointerException if the specified element is null and this |
316 |
> |
* deque does not permit null elements |
317 |
|
*/ |
318 |
|
boolean removeLastOccurrence(Object o); |
319 |
|
|
323 |
|
/** |
324 |
|
* Inserts the specified element into the queue represented by this deque |
325 |
|
* unless it would violate capacity restrictions. In other words, inserts |
326 |
< |
* the specified element to the end of this deque. When using a |
326 |
> |
* the specified element at the end of this deque. When using a |
327 |
|
* capacity-restricted deque, this method is generally preferable to the |
328 |
|
* {@link #add} method, which can fail to insert an element only by |
329 |
|
* throwing an exception. |