182 |
|
void addFirst(E e); |
183 |
|
|
184 |
|
/** |
185 |
< |
* Inserts the specified element at the end of this deque if it is |
185 |
> |
* Inserts the specified element at the end of this deque if it is |
186 |
|
* possible to do so immediately without violating capacity restrictions. |
187 |
|
* When using a capacity-restricted deque, it is generally preferable to |
188 |
|
* use method {@link #offerLast}. |
206 |
|
* which can fail to insert an element only by throwing an exception. |
207 |
|
* |
208 |
|
* @param e the element to add |
209 |
< |
* @return <tt>true</tt> if it was possible to insert the element, |
210 |
< |
* else <tt>false</tt> |
209 |
> |
* @return <tt>true</tt> if the element was added to this deque, else |
210 |
> |
* <tt>false</tt> |
211 |
|
* @throws ClassCastException if the class of the specified element |
212 |
|
* prevents it from being added to this deque |
213 |
|
* @throws NullPointerException if the specified element is null and this |
224 |
|
* which can fail to insert an element only by throwing an exception. |
225 |
|
* |
226 |
|
* @param e the element to add |
227 |
< |
* @return <tt>true</tt> if it was possible to insert the element, |
228 |
< |
* else <tt>false</tt> |
227 |
> |
* @return <tt>true</tt> if the element was added to this deque, else |
228 |
> |
* <tt>false</tt> |
229 |
|
* @throws ClassCastException if the class of the specified element |
230 |
|
* prevents it from being added to this deque |
231 |
|
* @throws NullPointerException if the specified element is null and this |
313 |
|
* More formally, removes the first element <tt>e</tt> such that |
314 |
|
* <tt>(o==null ? e==null : o.equals(e))</tt> |
315 |
|
* (if such an element exists). |
316 |
< |
* Returns true if this deque contained the specified element (or |
317 |
< |
* equivalently, if this deque changed as a result of the call). |
316 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
317 |
> |
* (or equivalently, if this deque changed as a result of the call). |
318 |
|
* |
319 |
|
* @param o element to be removed from this deque, if present |
320 |
|
* @return <tt>true</tt> if an element was removed as a result of this call |
331 |
|
* More formally, removes the last element <tt>e</tt> such that |
332 |
|
* <tt>(o==null ? e==null : o.equals(e))</tt> |
333 |
|
* (if such an element exists). |
334 |
< |
* Returns true if this deque contained the specified element (or |
335 |
< |
* equivalently, if this deque changed as a result of the call). |
334 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
335 |
> |
* (or equivalently, if this deque changed as a result of the call). |
336 |
|
* |
337 |
|
* @param o element to be removed from this deque, if present |
338 |
|
* @return <tt>true</tt> if an element was removed as a result of this call |
487 |
|
* More formally, removes the first element <tt>e</tt> such that |
488 |
|
* <tt>(o==null ? e==null : o.equals(e))</tt> |
489 |
|
* (if such an element exists). |
490 |
< |
* Returns true if this deque contained the specified element (or |
491 |
< |
* equivalently, if this deque changed as a result of the call). |
490 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
491 |
> |
* (or equivalently, if this deque changed as a result of the call). |
492 |
|
* |
493 |
|
* <p>This method is equivalent to {@link #removeFirstOccurrence}. |
494 |
|
* |
524 |
|
public int size(); |
525 |
|
|
526 |
|
/** |
527 |
< |
* Returns an iterator over the elements in this deque. The elements |
528 |
< |
* will be ordered from first (head) to last (tail). |
527 |
> |
* Returns an iterator over the elements in this deque in proper sequence. |
528 |
> |
* The elements will be returned in order from first (head) to last (tail). |
529 |
|
* |
530 |
< |
* @return an <tt>Iterator</tt> over the elements in this deque |
530 |
> |
* @return an iterator over the elements in this deque in proper sequence |
531 |
|
*/ |
532 |
|
Iterator<E> iterator(); |
533 |
|
} |