172 |
|
* @param e the element to add |
173 |
|
* @throws IllegalStateException if the element cannot be added at this |
174 |
|
* time due to capacity restrictions |
175 |
– |
* @throws NullPointerException if the specified element is null and this |
176 |
– |
* deque does not permit null elements |
175 |
|
* @throws ClassCastException if the class of the specified element |
176 |
|
* prevents it from being added to this deque |
177 |
+ |
* @throws NullPointerException if the specified element is null and this |
178 |
+ |
* deque does not permit null elements |
179 |
|
* @throws IllegalArgumentException if some property of the specified |
180 |
|
* element prevents it from being added to this deque |
181 |
|
*/ |
190 |
|
* @param e the element to add |
191 |
|
* @throws IllegalStateException if the element cannot be added at this |
192 |
|
* time due to capacity restrictions |
193 |
– |
* @throws NullPointerException if the specified element is null and this |
194 |
– |
* deque does not permit null elements |
193 |
|
* @throws ClassCastException if the class of the specified element |
194 |
|
* prevents it from being added to this deque |
195 |
+ |
* @throws NullPointerException if the specified element is null and this |
196 |
+ |
* deque does not permit null elements |
197 |
|
* @throws IllegalArgumentException if some property of the specified |
198 |
|
* element prevents it from being added to this deque |
199 |
|
*/ |
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> |
211 |
– |
* @throws NullPointerException if the specified element is null and this |
212 |
– |
* deque does not permit null elements |
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 |
214 |
+ |
* deque does not permit null elements |
215 |
|
* @throws IllegalArgumentException if some property of the specified |
216 |
|
* element prevents it from being added to this deque |
217 |
|
*/ |
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> |
229 |
– |
* @throws NullPointerException if the specified element is null and this |
230 |
– |
* deque does not permit null elements |
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 |
232 |
+ |
* deque does not permit null elements |
233 |
|
* @throws IllegalArgumentException if some property of the specified |
234 |
|
* element prevents it from being added to this deque |
235 |
|
*/ |
311 |
|
* Removes the first occurrence of the specified element from this deque. |
312 |
|
* If the deque does not contain the element, it is unchanged. |
313 |
|
* More formally, removes the first element <tt>e</tt> such that |
314 |
< |
* <tt>(o==null ? e==null : o.equals(e))</tt> (if such an element exists). |
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). |
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 |
321 |
+ |
* @throws ClassCastException if the class of the specified element |
322 |
+ |
* is incompatible with this deque (optional) |
323 |
|
* @throws NullPointerException if the specified element is null and this |
324 |
|
* deque does not permit null elements (optional) |
322 |
– |
* @throws ClassCastException if the class of the specified element |
323 |
– |
* is incompatible with this collection (optional) |
325 |
|
*/ |
326 |
|
boolean removeFirstOccurrence(Object o); |
327 |
|
|
329 |
|
* Removes the last occurrence of the specified element from this deque. |
330 |
|
* If the deque does not contain the element, it is unchanged. |
331 |
|
* More formally, removes the last element <tt>e</tt> such that |
332 |
< |
* <tt>(o==null ? e==null : o.equals(e))</tt> (if such an element exists). |
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). |
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 |
339 |
+ |
* @throws ClassCastException if the class of the specified element |
340 |
+ |
* is incompatible with this deque (optional) |
341 |
|
* @throws NullPointerException if the specified element is null and this |
342 |
|
* deque does not permit null elements (optional) |
339 |
– |
* @throws ClassCastException if the class of the specified element |
340 |
– |
* is incompatible with this collection (optional) |
343 |
|
*/ |
344 |
|
boolean removeLastOccurrence(Object o); |
345 |
|
|
360 |
|
* @return <tt>true</tt> (as per the spec for {@link Collection#add}) |
361 |
|
* @throws IllegalStateException if the element cannot be added at this |
362 |
|
* time due to capacity restrictions |
361 |
– |
* @throws NullPointerException if the specified element is null and this |
362 |
– |
* deque does not permit null elements |
363 |
|
* @throws ClassCastException if the class of the specified element |
364 |
|
* prevents it from being added to this deque |
365 |
+ |
* @throws NullPointerException if the specified element is null and this |
366 |
+ |
* deque does not permit null elements |
367 |
|
* @throws IllegalArgumentException if some property of the specified |
368 |
|
* element prevents it from being added to this deque |
369 |
|
*/ |
383 |
|
* @param e the element to add |
384 |
|
* @return <tt>true</tt> if the element was added to this deque, else |
385 |
|
* <tt>false</tt> |
384 |
– |
* @throws NullPointerException if the specified element is null and this |
385 |
– |
* deque does not permit null elements |
386 |
|
* @throws ClassCastException if the class of the specified element |
387 |
|
* prevents it from being added to this deque |
388 |
+ |
* @throws NullPointerException if the specified element is null and this |
389 |
+ |
* deque does not permit null elements |
390 |
|
* @throws IllegalArgumentException if some property of the specified |
391 |
|
* element prevents it from being added to this deque |
392 |
|
*/ |
457 |
|
* @param e the element to push |
458 |
|
* @throws IllegalStateException if the element cannot be added at this |
459 |
|
* time due to capacity restrictions |
458 |
– |
* @throws NullPointerException if the specified element is null and this |
459 |
– |
* deque does not permit null elements |
460 |
|
* @throws ClassCastException if the class of the specified element |
461 |
|
* prevents it from being added to this deque |
462 |
+ |
* @throws NullPointerException if the specified element is null and this |
463 |
+ |
* deque does not permit null elements |
464 |
|
* @throws IllegalArgumentException if some property of the specified |
465 |
|
* element prevents it from being added to this deque |
466 |
|
*/ |
485 |
|
* Removes the first occurrence of the specified element from this deque. |
486 |
|
* If the deque does not contain the element, it is unchanged. |
487 |
|
* More formally, removes the first element <tt>e</tt> such that |
488 |
< |
* <tt>(o==null ? e==null : o.equals(e))</tt> (if such an element exists). |
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). |
492 |
|
* |
494 |
|
* |
495 |
|
* @param o element to be removed from this deque, if present |
496 |
|
* @return <tt>true</tt> if an element was removed as a result of this call |
497 |
+ |
* @throws ClassCastException if the class of the specified element |
498 |
+ |
* is incompatible with this deque (optional) |
499 |
|
* @throws NullPointerException if the specified element is null and this |
500 |
|
* deque does not permit null elements (optional) |
496 |
– |
* @throws ClassCastException if the class of the specified element |
497 |
– |
* is incompatible with this collection (optional) |
501 |
|
*/ |
502 |
|
boolean remove(Object o); |
503 |
|
|
504 |
|
/** |
505 |
|
* Returns <tt>true</tt> if this deque contains the specified element. |
506 |
< |
* More formally, returns <tt>true</tt> if and only if this deque |
507 |
< |
* contains at least one element <tt>e</tt> such that <tt>(o==null ? |
508 |
< |
* e==null : o.equals(e))</tt>. |
506 |
> |
* More formally, returns <tt>true</tt> if and only if this deque contains |
507 |
> |
* at least one element <tt>e</tt> such that |
508 |
> |
* <tt>(o==null ? e==null : o.equals(e))</tt>. |
509 |
|
* |
510 |
|
* @param o element whose presence in this deque is to be tested |
511 |
|
* @return <tt>true</tt> if this deque contains the specified element |