29 |
|
* |
30 |
|
* <p> |
31 |
|
* <table BORDER CELLPADDING=3 CELLSPACING=1> |
32 |
+ |
* <caption>Summary of Deque methods</caption> |
33 |
|
* <tr> |
34 |
|
* <td></td> |
35 |
|
* <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td> |
73 |
|
* |
74 |
|
* <p> |
75 |
|
* <table BORDER CELLPADDING=3 CELLSPACING=1> |
76 |
+ |
* <caption>Comparison of Queue and Deque methods</caption> |
77 |
|
* <tr> |
78 |
|
* <td ALIGN=CENTER> <b>{@code Queue} Method</b></td> |
79 |
|
* <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td> |
112 |
|
* |
113 |
|
* <p> |
114 |
|
* <table BORDER CELLPADDING=3 CELLSPACING=1> |
115 |
+ |
* <caption>Comparison of Stack and Deque methods</caption> |
116 |
|
* <tr> |
117 |
|
* <td ALIGN=CENTER> <b>Stack Method</b></td> |
118 |
|
* <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td> |
167 |
|
public interface Deque<E> extends Queue<E> { |
168 |
|
/** |
169 |
|
* Inserts the specified element at the front of this deque if it is |
170 |
< |
* possible to do so immediately without violating capacity restrictions. |
171 |
< |
* When using a capacity-restricted deque, it is generally preferable to |
172 |
< |
* use method {@link #offerFirst}. |
170 |
> |
* possible to do so immediately without violating capacity restrictions, |
171 |
> |
* throwing an {@code IllegalStateException} if no space is currently |
172 |
> |
* available. When using a capacity-restricted deque, it is generally |
173 |
> |
* preferable to use method {@link #offerFirst}. |
174 |
|
* |
175 |
|
* @param e the element to add |
176 |
|
* @throws IllegalStateException if the element cannot be added at this |
186 |
|
|
187 |
|
/** |
188 |
|
* Inserts the specified element at the end of this deque if it is |
189 |
< |
* possible to do so immediately without violating capacity restrictions. |
190 |
< |
* When using a capacity-restricted deque, it is generally preferable to |
191 |
< |
* use method {@link #offerLast}. |
189 |
> |
* possible to do so immediately without violating capacity restrictions, |
190 |
> |
* throwing an {@code IllegalStateException} if no space is currently |
191 |
> |
* available. When using a capacity-restricted deque, it is generally |
192 |
> |
* preferable to use method {@link #offerLast}. |
193 |
|
* |
194 |
|
* <p>This method is equivalent to {@link #add}. |
195 |
|
* |
455 |
|
/** |
456 |
|
* Pushes an element onto the stack represented by this deque (in other |
457 |
|
* words, at the head of this deque) if it is possible to do so |
458 |
< |
* immediately without violating capacity restrictions, returning |
454 |
< |
* {@code true} upon success and throwing an |
458 |
> |
* immediately without violating capacity restrictions, throwing an |
459 |
|
* {@code IllegalStateException} if no space is currently available. |
460 |
|
* |
461 |
|
* <p>This method is equivalent to {@link #addFirst}. |