4 |
|
*/ |
5 |
|
|
6 |
|
package java.util; |
7 |
+ |
import java.util.*; // for javadoc (till 6280605 is fixed) |
8 |
|
import java.io.*; |
9 |
|
|
10 |
|
/** |
203 |
|
|
204 |
|
/** |
205 |
|
* Inserts the specified element at the end of this deque. |
206 |
< |
* This method is equivalent to {@link #add} and {@link #push}. |
206 |
> |
* |
207 |
> |
* <p>This method is equivalent to {@link #add}. |
208 |
|
* |
209 |
|
* @param e the element to add |
210 |
|
* @throws NullPointerException if the specified element is null |
221 |
|
* Inserts the specified element at the front of this deque. |
222 |
|
* |
223 |
|
* @param e the element to add |
224 |
< |
* @return <tt>true</tt> (as per the spec for {@link Deque#offerFirst}) |
224 |
> |
* @return <tt>true</tt> (as specified by {@link Deque#offerFirst}) |
225 |
|
* @throws NullPointerException if the specified element is null |
226 |
|
*/ |
227 |
|
public boolean offerFirst(E e) { |
233 |
|
* Inserts the specified element at the end of this deque. |
234 |
|
* |
235 |
|
* @param e the element to add |
236 |
< |
* @return <tt>true</tt> (as per the spec for {@link Deque#offerLast}) |
236 |
> |
* @return <tt>true</tt> (as specified by {@link Deque#offerLast}) |
237 |
|
* @throws NullPointerException if the specified element is null |
238 |
|
*/ |
239 |
|
public boolean offerLast(E e) { |
315 |
|
* If the deque does not contain the element, it is unchanged. |
316 |
|
* More formally, removes the first element <tt>e</tt> such that |
317 |
|
* <tt>o.equals(e)</tt> (if such an element exists). |
318 |
< |
* Returns true if this deque contained the specified element (or |
319 |
< |
* equivalently, if this deque changed as a result of the call). |
318 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
319 |
> |
* (or equivalently, if this deque changed as a result of the call). |
320 |
|
* |
321 |
|
* @param o element to be removed from this deque, if present |
322 |
|
* @return <tt>true</tt> if the deque contained the specified element |
343 |
|
* If the deque does not contain the element, it is unchanged. |
344 |
|
* More formally, removes the last element <tt>e</tt> such that |
345 |
|
* <tt>o.equals(e)</tt> (if such an element exists). |
346 |
< |
* Returns true if this deque contained the specified element (or |
347 |
< |
* equivalently, if this deque changed as a result of the call). |
346 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
347 |
> |
* (or equivalently, if this deque changed as a result of the call). |
348 |
|
* |
349 |
|
* @param o element to be removed from this deque, if present |
350 |
|
* @return <tt>true</tt> if the deque contained the specified element |
373 |
|
* <p>This method is equivalent to {@link #addLast}. |
374 |
|
* |
375 |
|
* @param e the element to add |
376 |
< |
* @return <tt>true</tt> (as per the spec for {@link Collection#add}) |
376 |
> |
* @return <tt>true</tt> (as specified by {@link Collection#add}) |
377 |
|
* @throws NullPointerException if the specified element is null |
378 |
|
*/ |
379 |
|
public boolean add(E e) { |
387 |
|
* <p>This method is equivalent to {@link #offerLast}. |
388 |
|
* |
389 |
|
* @param e the element to add |
390 |
< |
* @return <tt>true</tt> (as per the spec for {@link Queue#offer}) |
390 |
> |
* @return <tt>true</tt> (as specified by {@link Queue#offer}) |
391 |
|
* @throws NullPointerException if the specified element is null |
392 |
|
*/ |
393 |
|
public boolean offer(E e) { |
396 |
|
|
397 |
|
/** |
398 |
|
* Retrieves and removes the head of the queue represented by this deque. |
399 |
< |
* This method differs from {@link #poll} only in that it throws an |
399 |
> |
* |
400 |
> |
* This method differs from {@link #poll poll} only in that it throws an |
401 |
|
* exception if this deque is empty. |
402 |
|
* |
403 |
|
* <p>This method is equivalent to {@link #removeFirst}. |
425 |
|
|
426 |
|
/** |
427 |
|
* Retrieves, but does not remove, the head of the queue represented by |
428 |
< |
* this deque. This method differs from {@link #peek} only in that it |
429 |
< |
* throws an exception if this deque is empty. |
428 |
> |
* this deque. This method differs from {@link #peek peek} only in |
429 |
> |
* that it throws an exception if this deque is empty. |
430 |
|
* |
431 |
|
* <p>This method is equivalent to {@link #getFirst}. |
432 |
|
* |
616 |
|
* If the deque does not contain the element, it is unchanged. |
617 |
|
* More formally, removes the first element <tt>e</tt> such that |
618 |
|
* <tt>o.equals(e)</tt> (if such an element exists). |
619 |
< |
* Returns true if this deque contained the specified element (or |
620 |
< |
* equivalently, if this deque changed as a result of the call). |
619 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
620 |
> |
* (or equivalently, if this deque changed as a result of the call). |
621 |
|
* |
622 |
|
* <p>This method is equivalent to {@link #removeFirstOccurrence}. |
623 |
|
* |
653 |
|
* <p>The returned array will be "safe" in that no references to it are |
654 |
|
* maintained by this deque. (In other words, this method must allocate |
655 |
|
* a new array). The caller is thus free to modify the returned array. |
656 |
< |
* |
656 |
> |
* |
657 |
|
* <p>This method acts as bridge between array-based and collection-based |
658 |
|
* APIs. |
659 |
|
* |