Warning
The methods of ForwardingDeque forward indiscriminately to the
methods of the delegate. For example, overriding add alone will not change the
behavior of offer which can lead to unexpected behavior. In this case, you should
override offer as well.
default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations
invoke methods, they invoke methods on the ForwardingDeque.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFirst(E
the element to add e)Implements java. IllegalStateException if no space is currently
available.
|
| public void | addLast(E
the element to add e)Implements java. IllegalStateException if no space is currently
available.
|
| protected abstract Deque | delegate()
Implements abstract com. |
| public Iterator | descendingIterator()
Implements java. |
| public E | getFirst()
Implements java. |
| public E | getLast()
Implements java. |
| public boolean | offerFirst(E
the element to add e)Implements java. |
| public boolean | offerLast(E
the element to add e)Implements java. |
| public E | peekFirst()
Implements java. null if this deque is empty.
|
| public E | peekLast()
Implements java. null if this deque is empty.
|
| public E | pollFirst()
Implements java. null if this deque is empty.
|
| public E | pollLast()
Implements java. null if this deque is empty.
|
| public E | |
| public void | push(E
the element to push e)Implements java. IllegalStateException if no space is currently available.
|
| public E | removeFirst()
Implements java. |
| public boolean | removeFirstOccurrence(Object
element to be removed from this deque, if present o)Implements java. |
| public E | removeLast()
Implements java. |
| public boolean | removeLastOccurrence(Object
element to be removed from this deque, if present o)Implements java. |
| ForwardingDeque | back to summary |
|---|---|
| protected ForwardingDeque() Constructor for use by subclasses. | |
| 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
| |
| delegate | back to summary |
|---|---|
| protected abstract Deque Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |
| 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). | |
| 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
| |
| 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
| |
| 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
| |
| 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
| |
| 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
| |