5 |
|
*/ |
6 |
|
|
7 |
|
package java.util; |
8 |
+ |
import java.util.*; // for javadoc |
9 |
|
|
10 |
|
/** |
11 |
|
* A linear collection that supports element insertion and removal at |
183 |
|
void addFirst(E e); |
184 |
|
|
185 |
|
/** |
186 |
< |
* Inserts the specified element at the end of this deque if it is |
186 |
> |
* Inserts the specified element at the end of this deque if it is |
187 |
|
* possible to do so immediately without violating capacity restrictions. |
188 |
|
* When using a capacity-restricted deque, it is generally preferable to |
189 |
|
* use method {@link #offerLast}. |
190 |
|
* |
191 |
+ |
* <p>This method is equivalent to {@link #add}. |
192 |
+ |
* |
193 |
|
* @param e the element to add |
194 |
|
* @throws IllegalStateException if the element cannot be added at this |
195 |
|
* time due to capacity restrictions |
209 |
|
* which can fail to insert an element only by throwing an exception. |
210 |
|
* |
211 |
|
* @param e the element to add |
212 |
< |
* @return <tt>true</tt> if it was possible to insert the element, |
213 |
< |
* else <tt>false</tt> |
212 |
> |
* @return <tt>true</tt> if the element was added to this deque, else |
213 |
> |
* <tt>false</tt> |
214 |
|
* @throws ClassCastException if the class of the specified element |
215 |
|
* prevents it from being added to this deque |
216 |
|
* @throws NullPointerException if the specified element is null and this |
227 |
|
* which can fail to insert an element only by throwing an exception. |
228 |
|
* |
229 |
|
* @param e the element to add |
230 |
< |
* @return <tt>true</tt> if it was possible to insert the element, |
231 |
< |
* else <tt>false</tt> |
230 |
> |
* @return <tt>true</tt> if the element was added to this deque, else |
231 |
> |
* <tt>false</tt> |
232 |
|
* @throws ClassCastException if the class of the specified element |
233 |
|
* prevents it from being added to this deque |
234 |
|
* @throws NullPointerException if the specified element is null and this |
316 |
|
* More formally, removes the first element <tt>e</tt> such that |
317 |
|
* <tt>(o==null ? e==null : o.equals(e))</tt> |
318 |
|
* (if such an element exists). |
319 |
< |
* Returns true if this deque contained the specified element (or |
320 |
< |
* equivalently, if this deque changed as a result of the call). |
319 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
320 |
> |
* (or equivalently, if this deque changed as a result of the call). |
321 |
|
* |
322 |
|
* @param o element to be removed from this deque, if present |
323 |
|
* @return <tt>true</tt> if an element was removed as a result of this call |
334 |
|
* More formally, removes the last element <tt>e</tt> such that |
335 |
|
* <tt>(o==null ? e==null : o.equals(e))</tt> |
336 |
|
* (if such an element exists). |
337 |
< |
* Returns true if this deque contained the specified element (or |
338 |
< |
* equivalently, if this deque changed as a result of the call). |
337 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
338 |
> |
* (or equivalently, if this deque changed as a result of the call). |
339 |
|
* |
340 |
|
* @param o element to be removed from this deque, if present |
341 |
|
* @return <tt>true</tt> if an element was removed as a result of this call |
357 |
|
* When using a capacity-restricted deque, it is generally preferable to |
358 |
|
* use {@link #offer(Object) offer}. |
359 |
|
* |
360 |
< |
* <p>This method is equivalent to {@link #addLast(Object) addLast}. |
360 |
> |
* <p>This method is equivalent to {@link #addLast}. |
361 |
|
* |
362 |
|
* @param e the element to add |
363 |
|
* @return <tt>true</tt> (as per the spec for {@link Collection#add}) |
490 |
|
* More formally, removes the first element <tt>e</tt> such that |
491 |
|
* <tt>(o==null ? e==null : o.equals(e))</tt> |
492 |
|
* (if such an element exists). |
493 |
< |
* Returns true if this deque contained the specified element (or |
494 |
< |
* equivalently, if this deque changed as a result of the call). |
493 |
> |
* Returns <tt>true</tt> if this deque contained the specified element |
494 |
> |
* (or equivalently, if this deque changed as a result of the call). |
495 |
|
* |
496 |
|
* <p>This method is equivalent to {@link #removeFirstOccurrence}. |
497 |
|
* |