153 |
|
* <tt>Object</tt>. |
154 |
|
* |
155 |
|
* <p>This interface is a member of the <a |
156 |
< |
* href="{@docRoot}/../guide/collections/index.html"> Java Collections |
156 |
> |
* href="{@docRoot}/../technotes/guides/collections/index.html"> Java Collections |
157 |
|
* Framework</a>. |
158 |
|
* |
159 |
|
* @author Doug Lea |
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}. |
189 |
|
* |
190 |
+ |
* <p>This method is equivalent to {@link #add}. |
191 |
+ |
* |
192 |
|
* @param e the element to add |
193 |
|
* @throws IllegalStateException if the element cannot be added at this |
194 |
|
* time due to capacity restrictions |
239 |
|
|
240 |
|
/** |
241 |
|
* Retrieves and removes the first element of this deque. This method |
242 |
< |
* differs from {@link #pollFirst} only in that it throws an exception |
243 |
< |
* if this deque is empty. |
242 |
> |
* differs from {@link #pollFirst pollFirst} only in that it throws an |
243 |
> |
* exception if this deque is empty. |
244 |
|
* |
245 |
|
* @return the head of this deque |
246 |
|
* @throws NoSuchElementException if this deque is empty |
249 |
|
|
250 |
|
/** |
251 |
|
* Retrieves and removes the last element of this deque. This method |
252 |
< |
* differs from {@link #pollLast} only in that it throws an exception if |
253 |
< |
* this deque is empty. |
252 |
> |
* differs from {@link #pollLast pollLast} only in that it throws an |
253 |
> |
* exception if this deque is empty. |
254 |
|
* |
255 |
|
* @return the tail of this deque |
256 |
|
* @throws NoSuchElementException if this deque is empty |
275 |
|
|
276 |
|
/** |
277 |
|
* Retrieves, but does not remove, the first element of this deque. |
278 |
< |
* This method differs from {@link #peekFirst} only in that it throws an |
279 |
< |
* exception if this deque is empty. |
278 |
> |
* |
279 |
> |
* This method differs from {@link #peekFirst peekFirst} only in that it |
280 |
> |
* throws an exception if this deque is empty. |
281 |
|
* |
282 |
|
* @return the head of this deque |
283 |
|
* @throws NoSuchElementException if this deque is empty |
286 |
|
|
287 |
|
/** |
288 |
|
* Retrieves, but does not remove, the last element of this deque. |
289 |
< |
* This method differs from {@link #peekLast} only in that it throws an |
290 |
< |
* exception if this deque is empty. |
289 |
> |
* This method differs from {@link #peekLast peekLast} only in that it |
290 |
> |
* throws an exception if this deque is empty. |
291 |
|
* |
292 |
|
* @return the tail of this deque |
293 |
|
* @throws NoSuchElementException if this deque is empty |
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}) |
363 |
> |
* @return <tt>true</tt> (as specified by {@link Collection#add}) |
364 |
|
* @throws IllegalStateException if the element cannot be added at this |
365 |
|
* time due to capacity restrictions |
366 |
|
* @throws ClassCastException if the class of the specified element |
398 |
|
/** |
399 |
|
* Retrieves and removes the head of the queue represented by this deque |
400 |
|
* (in other words, the first element of this deque). |
401 |
< |
* This method differs from {@link #poll} only in that it throws an |
401 |
> |
* This method differs from {@link #poll poll} only in that it throws an |
402 |
|
* exception if this deque is empty. |
403 |
|
* |
404 |
|
* <p>This method is equivalent to {@link #removeFirst()}. |
423 |
|
/** |
424 |
|
* Retrieves, but does not remove, the head of the queue represented by |
425 |
|
* this deque (in other words, the first element of this deque). |
426 |
< |
* This method differs from {@link #peek} only in that it throws an |
426 |
> |
* This method differs from {@link #peek peek} only in that it throws an |
427 |
|
* exception if this deque is empty. |
428 |
|
* |
429 |
|
* <p>This method is equivalent to {@link #getFirst()}. |
533 |
|
* @return an iterator over the elements in this deque in proper sequence |
534 |
|
*/ |
535 |
|
Iterator<E> iterator(); |
536 |
+ |
|
537 |
+ |
/** |
538 |
+ |
* Returns an iterator over the elements in this deque in reverse |
539 |
+ |
* sequential order. The elements will be returned in order from |
540 |
+ |
* last (tail) to first (head). |
541 |
+ |
* |
542 |
+ |
* @return an iterator over the elements in this deque in reverse |
543 |
+ |
* sequence |
544 |
+ |
*/ |
545 |
+ |
Iterator<E> descendingIterator(); |
546 |
+ |
|
547 |
|
} |