Java java.util Deque fields, constructors, methods, implement or subclass

Example usage for Java java.util Deque fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util Deque.

The text is from its open source code.

Implementation

java.util.Deque has the following implementations.
Click this link to see all its implementation.

Method

booleanadd(E e)
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 true upon success and throwing an IllegalStateException if no space is currently available.
booleanaddAll(Collection c)
Adds all of the elements in the specified collection at the end of this deque, as if by calling #addLast on each one, in the order that they are returned by the collection's iterator.
voidaddFirst(E e)
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException if no space is currently available.
voidaddLast(E e)
Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException if no space is currently available.
voidclear()
Removes all of the elements from this collection (optional operation).
booleancontains(Object o)
Returns true if this deque contains the specified element.
booleancontainsAll(Collection c)
Returns true if this collection contains all of the elements in the specified collection.
IteratordescendingIterator()
Returns an iterator over the elements in this deque in reverse sequential order.
Eelement()
Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque).
voidforEach(Consumer action)
Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.
EgetFirst()
Retrieves, but does not remove, the first element of this deque.
EgetLast()
Retrieves, but does not remove, the last element of this deque.
booleanisEmpty()
Returns true if this collection contains no elements.
Iteratoriterator()
Returns an iterator over the elements in this deque in proper sequence.
booleanoffer(E e)
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 true upon success and false if no space is currently available.
booleanofferFirst(E e)
Inserts the specified element at the front of this deque unless it would violate capacity restrictions.
booleanofferLast(E e)
Inserts the specified element at the end of this deque unless it would violate capacity restrictions.
Epeek()
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 null if this deque is empty.
EpeekFirst()
Retrieves, but does not remove, the first element of this deque, or returns null if this deque is empty.
EpeekLast()
Retrieves, but does not remove, the last element of this deque, or returns null if this deque is empty.
Epoll()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty.
EpollFirst()
Retrieves and removes the first element of this deque, or returns null if this deque is empty.
EpollLast()
Retrieves and removes the last element of this deque, or returns null if this deque is empty.
Epop()
Pops an element from the stack represented by this deque.
voidpush(E e)
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 IllegalStateException if no space is currently available.
booleanremove(Object o)
Removes the first occurrence of the specified element from this deque.
Eremove()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque).
booleanremoveAll(Collection c)
Removes all of this collection's elements that are also contained in the specified collection (optional operation).
EremoveFirst()
Retrieves and removes the first element of this deque.
booleanremoveFirstOccurrence(Object o)
Removes the first occurrence of the specified element from this deque.
EremoveLast()
Retrieves and removes the last element of this deque.
booleanremoveLastOccurrence(Object o)
Removes the last occurrence of the specified element from this deque.
intsize()
Returns the number of elements in this deque.
Streamstream()
Returns a sequential Stream with this collection as its source.
Object[]toArray()
Returns an array containing all of the elements in this collection.
T[]toArray(T[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.