1019 |
|
public void push(E e) { addFirst(e); } |
1020 |
|
|
1021 |
|
/** |
1022 |
< |
* Removes the first element {@code e} such that |
1023 |
< |
* {@code o.equals(e)}, if such an element exists in this deque. |
1022 |
> |
* Removes the first occurrence of the specified element from this deque. |
1023 |
|
* If the deque does not contain the element, it is unchanged. |
1024 |
+ |
* More formally, removes the first element {@code e} such that |
1025 |
+ |
* {@code o.equals(e)} (if such an element exists). |
1026 |
+ |
* Returns {@code true} if this deque contained the specified element |
1027 |
+ |
* (or equivalently, if this deque changed as a result of the call). |
1028 |
|
* |
1029 |
|
* @param o element to be removed from this deque, if present |
1030 |
|
* @return {@code true} if the deque contained the specified element |
1043 |
|
} |
1044 |
|
|
1045 |
|
/** |
1046 |
< |
* Removes the last element {@code e} such that |
1044 |
< |
* {@code o.equals(e)}, if such an element exists in this deque. |
1046 |
> |
* Removes the last occurrence of the specified element from this deque. |
1047 |
|
* If the deque does not contain the element, it is unchanged. |
1048 |
+ |
* More formally, removes the last element {@code e} such that |
1049 |
+ |
* {@code o.equals(e)} (if such an element exists). |
1050 |
+ |
* Returns {@code true} if this deque contained the specified element |
1051 |
+ |
* (or equivalently, if this deque changed as a result of the call). |
1052 |
|
* |
1053 |
|
* @param o element to be removed from this deque, if present |
1054 |
|
* @return {@code true} if the deque contained the specified element |
1067 |
|
} |
1068 |
|
|
1069 |
|
/** |
1070 |
< |
* Returns {@code true} if this deque contains at least one |
1071 |
< |
* element {@code e} such that {@code o.equals(e)}. |
1070 |
> |
* Returns {@code true} if this deque contains the specified element. |
1071 |
> |
* More formally, returns {@code true} if and only if this deque contains |
1072 |
> |
* at least one element {@code e} such that {@code o.equals(e)}. |
1073 |
|
* |
1074 |
|
* @param o element whose presence in this deque is to be tested |
1075 |
|
* @return {@code true} if this deque contains the specified element |
1127 |
|
} |
1128 |
|
|
1129 |
|
/** |
1130 |
< |
* Removes the first element {@code e} such that |
1124 |
< |
* {@code o.equals(e)}, if such an element exists in this deque. |
1130 |
> |
* Removes the first occurrence of the specified element from this deque. |
1131 |
|
* If the deque does not contain the element, it is unchanged. |
1132 |
+ |
* More formally, removes the first element {@code e} such that |
1133 |
+ |
* {@code o.equals(e)} (if such an element exists). |
1134 |
+ |
* Returns {@code true} if this deque contained the specified element |
1135 |
+ |
* (or equivalently, if this deque changed as a result of the call). |
1136 |
+ |
* |
1137 |
+ |
* <p>This method is equivalent to {@link #removeFirstOccurrence(Object)}. |
1138 |
|
* |
1139 |
|
* @param o element to be removed from this deque, if present |
1140 |
|
* @return {@code true} if the deque contained the specified element |