44 |
|
* </tr> |
45 |
|
* <tr> |
46 |
|
* <td><b>Insert</b></td> |
47 |
< |
* <td>{@link #addFirst addFirst(e)}</td> |
48 |
< |
* <td>{@link #offerFirst offerFirst(e)}</td> |
49 |
< |
* <td>{@link #addLast addLast(e)}</td> |
50 |
< |
* <td>{@link #offerLast offerLast(e)}</td> |
47 |
> |
* <td>{@link Deque#addFirst addFirst(e)}</td> |
48 |
> |
* <td>{@link Deque#offerFirst offerFirst(e)}</td> |
49 |
> |
* <td>{@link Deque#addLast addLast(e)}</td> |
50 |
> |
* <td>{@link Deque#offerLast offerLast(e)}</td> |
51 |
|
* </tr> |
52 |
|
* <tr> |
53 |
|
* <td><b>Remove</b></td> |
54 |
< |
* <td>{@link #removeFirst removeFirst()}</td> |
55 |
< |
* <td>{@link #pollFirst pollFirst()}</td> |
56 |
< |
* <td>{@link #removeLast removeLast()}</td> |
57 |
< |
* <td>{@link #pollLast pollLast()}</td> |
54 |
> |
* <td>{@link Deque#removeFirst removeFirst()}</td> |
55 |
> |
* <td>{@link Deque#pollFirst pollFirst()}</td> |
56 |
> |
* <td>{@link Deque#removeLast removeLast()}</td> |
57 |
> |
* <td>{@link Deque#pollLast pollLast()}</td> |
58 |
|
* </tr> |
59 |
|
* <tr> |
60 |
|
* <td><b>Examine</b></td> |
61 |
< |
* <td>{@link #getFirst getFirst()}</td> |
62 |
< |
* <td>{@link #peekFirst peekFirst()}</td> |
63 |
< |
* <td>{@link #getLast getLast()}</td> |
64 |
< |
* <td>{@link #peekLast peekLast()}</td> |
61 |
> |
* <td>{@link Deque#getFirst getFirst()}</td> |
62 |
> |
* <td>{@link Deque#peekFirst peekFirst()}</td> |
63 |
> |
* <td>{@link Deque#getLast getLast()}</td> |
64 |
> |
* <td>{@link Deque#peekLast peekLast()}</td> |
65 |
|
* </tr> |
66 |
|
* </table> |
67 |
|
* |
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 |
457 |
< |
* {@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}. |