Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public boolean | add(E
the element to add e)Implements java. Inserts the specified element into the queue represented by this deque
(in other words, at the tail of this deque) if it is possible to do so
immediately without violating capacity restrictions, returning
|
public boolean | addAll(Collection<? extends E>
the elements to be inserted into this deque c)Implements java. Adds all of the elements in the specified collection at the end
of this deque, as if by calling |
public void | addFirst(E
the element to add e)Implements java. Inserts the specified element at the front of this deque if it is
possible to do so immediately without violating capacity restrictions,
throwing an |
public void | addLast(E
the element to add e)Implements java. Inserts the specified element at the end of this deque if it is
possible to do so immediately without violating capacity restrictions,
throwing an |
public void | clear()
Implements java. Removes all of the elements from this collection (optional operation). |
public boolean | contains(Object
element whose presence in this deque is to be tested o)Implements java. Returns |
public boolean | containsAll(Collection<?>
collection to be checked for containment in this collection c)Implements java. Returns |
public Iterator | descendingIterator()
Implements java. Returns an iterator over the elements in this deque in reverse sequential order. |
public E | element()
Implements java. Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque). |
public void | forEach(Consumer<? super E>
The action to be performed for each element action)Overrides default java. Performs the given action for each element of the |
public E | getFirst()
Implements java. Retrieves, but does not remove, the first element of this deque. |
public E | getLast()
Implements java. Retrieves, but does not remove, the last element of this deque. |
public boolean | isEmpty()
Implements java. Returns |
public Iterator | iterator()
Implements java. Returns an iterator over the elements in this deque in proper sequence. |
public static <T> Deque | |
public boolean | offer(E
the element to add e)Implements java. Inserts the specified element into the queue represented by this deque
(in other words, at the tail of this deque) if it is possible to do so
immediately without violating capacity restrictions, returning
|
public boolean | offerFirst(E
the element to add e)Implements java. Inserts the specified element at the front of this deque unless it would violate capacity restrictions. |
public boolean | offerLast(E
the element to add e)Implements java. Inserts the specified element at the end of this deque unless it would violate capacity restrictions. |
public Stream | parallelStream()
Overrides default java. Returns a possibly parallel |
public E | peek()
Implements java. Retrieves, but does not remove, the head of the queue represented by
this deque (in other words, the first element of this deque), or
returns |
public E | peekFirst()
Implements java. Retrieves, but does not remove, the first element of this deque,
or returns |
public E | peekLast()
Implements java. Retrieves, but does not remove, the last element of this deque,
or returns |
public E | poll()
Implements java. Retrieves and removes the head of the queue represented by this deque
(in other words, the first element of this deque), or returns
|
public E | pollFirst()
Implements java. Retrieves and removes the first element of this deque,
or returns |
public E | pollLast()
Implements java. Retrieves and removes the last element of this deque,
or returns |
public E | |
public void | push(E
the element to push e)Implements java. Pushes an element onto the stack represented by this deque (in other
words, at the head of this deque) if it is possible to do so
immediately without violating capacity restrictions, throwing an
|
public boolean | remove(Object
element to be removed from this deque, if present o)Implements java. Removes the first occurrence of the specified element from this deque. |
public E | remove()
Implements java. Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque). |
public boolean | removeAll(Collection<?>
collection containing elements to be removed from this collection c)Implements java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). |
public E | removeFirst()
Implements java. Retrieves and removes the first element of this deque. |
public boolean | removeFirstOccurrence(Object
element to be removed from this deque, if present o)Implements java. Removes the first occurrence of the specified element from this deque. |
public E | removeLast()
Implements java. Retrieves and removes the last element of this deque. |
public boolean | removeLastOccurrence(Object
element to be removed from this deque, if present o)Implements java. Removes the last occurrence of the specified element from this deque. |
public boolean | retainAll(Collection<?>
collection containing elements to be retained in this collection c)Implements java. Retains only the elements in this collection that are contained in the specified collection (optional operation). |
public int | |
public Spliterator | spliterator()
Overrides default java. Creates a |
public Stream | stream()
Overrides default java. Returns a sequential |
public Object[] | toArray()
Implements java. Returns an array containing all of the elements in this collection. |
public <T> T[] | toArray(T[]
the array into which the elements of this collection are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose. a)Implements java. Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. |
public <T> T[] | toArray(IntFunction<T[]>
a function which produces a new array of the desired
type and the provided length generator)Overrides default java. Returns an array containing all of the elements in this collection,
using the provided |
public String |
base | back to summary |
---|---|
pack-priv final Deque<E> base |
ReverseOrderDequeView | back to summary |
---|---|
private ReverseOrderDequeView(Deque<E> deque) |
add | back to summary |
---|---|
public boolean add(E e) Implements java. Doc from java. Inserts the specified element into the queue represented by this deque
(in other words, at the tail of this deque) if it is possible to do so
immediately without violating capacity restrictions, returning
This method is equivalent to
|
addAll | back to summary |
---|---|
public boolean addAll(Collection<? extends E> c) Implements java. Doc from java. Adds all of the elements in the specified collection at the end
of this deque, as if by calling When using a capacity-restricted deque, it is generally preferable
to call An exception encountered while trying to add an element may result in only some of the elements having been successfully added when the associated exception is thrown.
|
addFirst | back to summary |
---|---|
public void addFirst(E e) Implements java. Doc from java. Inserts the specified element at the front of this deque if it is
possible to do so immediately without violating capacity restrictions,
throwing an
|
addLast | back to summary |
---|---|
public void addLast(E e) Implements java. Doc from java. Inserts the specified element at the end of this deque if it is
possible to do so immediately without violating capacity restrictions,
throwing an This method is equivalent to
|
clear | back to summary |
---|---|
public void clear() Implements java. Doc from java. Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns. |
contains | back to summary |
---|---|
public boolean contains(Object o) Implements java. Doc from java. Returns
|
containsAll | back to summary |
---|---|
public boolean containsAll(Collection<?> c) Implements java. Doc from java. Returns
|
descendingIterator | back to summary |
---|---|
public Iterator Implements java. Doc from java. Returns an iterator over the elements in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head).
|
element | back to summary |
---|---|
public E element() Implements java. Doc from java. Retrieves, but does not remove, the head of the queue represented by
this deque (in other words, the first element of this deque).
This method differs from This method is equivalent to
|
forEach | back to summary |
---|---|
public void forEach(Consumer<? super E> action) Overrides default java. Doc from java. Performs the given action for each element of the The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.
|
getFirst | back to summary |
---|---|
public E getFirst() Implements java. Doc from java. Retrieves, but does not remove, the first element of this deque.
This method differs from
|
getLast | back to summary |
---|---|
public E getLast() Implements java. Doc from java. Retrieves, but does not remove, the last element of this deque.
This method differs from
|
isEmpty | back to summary |
---|---|
public boolean isEmpty() Implements java. Doc from java. Returns
|
iterator | back to summary |
---|---|
public Iterator Implements java. Doc from java. Returns an iterator over the elements in this deque in proper sequence. The elements will be returned in order from first (head) to last (tail).
|
of | back to summary |
---|---|
public static <T> Deque |
offer | back to summary |
---|---|
public boolean offer(E e) Implements java. Doc from java. Inserts the specified element into the queue represented by this deque
(in other words, at the tail of this deque) if it is possible to do so
immediately without violating capacity restrictions, returning
This method is equivalent to
|
offerFirst | back to summary |
---|---|
public boolean offerFirst(E e) Implements java. Doc from java. Inserts the specified element at the front of this deque unless it would
violate capacity restrictions. When using a capacity-restricted deque,
this method is generally preferable to the
|
offerLast | back to summary |
---|---|
public boolean offerLast(E e) Implements java. Doc from java. Inserts the specified element at the end of this deque unless it would
violate capacity restrictions. When using a capacity-restricted deque,
this method is generally preferable to the
|
parallelStream | back to summary |
---|---|
public Stream Overrides default java. Doc from java. Returns a possibly parallel This method should be overridden when the
|
peek | back to summary |
---|---|
public E peek() Implements java. Doc from java. Retrieves, but does not remove, the head of the queue represented by
this deque (in other words, the first element of this deque), or
returns This method is equivalent to
|
peekFirst | back to summary |
---|---|
public E peekFirst() Implements java. Doc from java. Retrieves, but does not remove, the first element of this deque,
or returns
|
peekLast | back to summary |
---|---|
public E peekLast() Implements java. Doc from java. Retrieves, but does not remove, the last element of this deque,
or returns
|
poll | back to summary |
---|---|
public E poll() Implements java. Doc from java. Retrieves and removes the head of the queue represented by this deque
(in other words, the first element of this deque), or returns
This method is equivalent to
|
pollFirst | back to summary |
---|---|
public E pollFirst() Implements java. Doc from java. Retrieves and removes the first element of this deque,
or returns
|
pollLast | back to summary |
---|---|
public E pollLast() Implements java. Doc from java. Retrieves and removes the last element of this deque,
or returns
|
pop | back to summary |
---|---|
public E pop() Implements java. Doc from java. Pops an element from the stack represented by this deque. In other words, removes and returns the first element of this deque. This method is equivalent to
|
push | back to summary |
---|---|
public void push(E e) Implements java. Doc from java. Pushes an element onto the stack represented by this deque (in other
words, at the head of this deque) if it is possible to do so
immediately without violating capacity restrictions, throwing an
This method is equivalent to
|
remove | back to summary |
---|---|
public boolean remove(Object o) Implements java. Doc from java. Removes the first occurrence of the specified element from this deque.
If the deque does not contain the element, it is unchanged.
More formally, removes the first element This method is equivalent to
|
remove | back to summary |
---|---|
public E remove() Implements java. Doc from java. Retrieves and removes the head of the queue represented by this deque
(in other words, the first element of this deque).
This method differs from This method is equivalent to
|
removeAll | back to summary |
---|---|
public boolean removeAll(Collection<?> c) Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
|
removeFirst | back to summary |
---|---|
public E removeFirst() Implements java. Doc from java. Retrieves and removes the first element of this deque. This method
differs from
|
removeFirstOccurrence | back to summary |
---|---|
public boolean removeFirstOccurrence(Object o) Implements java. Doc from java. Removes the first occurrence of the specified element from this deque.
If the deque does not contain the element, it is unchanged.
More formally, removes the first element
|
removeLast | back to summary |
---|---|
public E removeLast() Implements java. Doc from java. Retrieves and removes the last element of this deque. This method
differs from
|
removeLastOccurrence | back to summary |
---|---|
public boolean removeLastOccurrence(Object o) Implements java. Doc from java. Removes the last occurrence of the specified element from this deque.
If the deque does not contain the element, it is unchanged.
More formally, removes the last element
|
retainAll | back to summary |
---|---|
public boolean retainAll(Collection<?> c) Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
|
size | back to summary |
---|---|
public int size() Implements java. Doc from java. Returns the number of elements in this deque.
|
spliterator | back to summary |
---|---|
public Spliterator Overrides default java. Doc from java. Creates a The default implementation should be overridden by subclasses that
can return a more efficient spliterator. In order to
preserve expected laziness behavior for the
These requirements ensure that streams produced by the
|
stream | back to summary |
---|---|
public Stream Overrides default java. Doc from java. Returns a sequential This method should be overridden when the
|
toArray | back to summary |
---|---|
public Object[] toArray() Implements java. Doc from java. Returns an array containing all of the elements in this collection.
If this collection makes any guarantees as to what order its elements
are returned by its iterator, this method must return the elements in
the same order. The returned array's runtime component type is The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
|
toArray | back to summary |
---|---|
public <T> T[] toArray(T[] a) Implements java. Doc from java. Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection. If this collection fits in the specified array with room to spare
(i.e., the array has more elements than this collection), the element
in the array immediately following the end of the collection is set to
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
|
toArray | back to summary |
---|---|
public <T> T[] toArray(IntFunction<T[]> generator) Overrides default java. Doc from java. Returns an array containing all of the elements in this collection,
using the provided If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
|