class ConcurrentLinkedDeque[E <: AnyRef] extends AbstractCollection[E] with Deque[E] with Serializable
- Annotations
- @SerialVersionUID()
- Alphabetic
- By Inheritance
- ConcurrentLinkedDeque
- Serializable
- Deque
- SequencedCollection
- Queue
- AbstractCollection
- Collection
- Iterable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ConcurrentLinkedDeque(c: Collection[_ <: E])
Constructs a deque initially containing the elements of the given collection, added in traversal order of the collection's iterator.
Constructs a deque initially containing the elements of the given collection, added in traversal order of the collection's iterator.
- c
the collection of elements to initially contain throws NullPointerException if the specified collection or any of its elements are null
- new ConcurrentLinkedDeque()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def add(e: E): Boolean
Inserts the specified element at the tail of this deque.
Inserts the specified element at the tail of this deque. As the deque is unbounded, this method will never throw IllegalStateException or return
false
.- returns
true
(as specified byadd
) throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque → Queue → AbstractCollection → Collection
- def addAll(c: Collection[_ <: E]): Boolean
Appends all of the elements in the specified collection to the end of this deque, in the order that they are returned by the specified collection's iterator.
Appends all of the elements in the specified collection to the end of this deque, in the order that they are returned by the specified collection's iterator. Attempts to
addAll
of a deque to itself result inIllegalArgumentException
.- c
the elements to be inserted into this deque
- returns
true
if this deque changed as a result of the call throws NullPointerException if the specified collection or any of its elements are null throws IllegalArgumentException if the collection is this deque
- Definition Classes
- ConcurrentLinkedDeque → AbstractCollection → Collection
- def addFirst(e: E): Unit
Inserts the specified element at the front of this deque.
Inserts the specified element at the front of this deque. As the deque is unbounded, this method will never throw IllegalStateException.
throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def addLast(e: E): Unit
Inserts the specified element at the end of this deque.
Inserts the specified element at the end of this deque. As the deque is unbounded, this method will never throw IllegalStateException.
This method is equivalent to add().
throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clear(): Unit
Removes all of the elements from this deque.
Removes all of the elements from this deque.
- Definition Classes
- ConcurrentLinkedDeque → AbstractCollection → Collection
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def contains(o: Any): Boolean
Returns
true
if this deque contains the specified element.Returns
true
if this deque contains the specified element. More formally, returnstrue
if and only if this deque contains at least one elemente
such thato.equals(e)
.- o
element whose presence in this deque is to be tested
- returns
true
if this deque contains the specified element
- Definition Classes
- ConcurrentLinkedDeque → Deque → AbstractCollection → Collection
- def containsAll(c: Collection[_]): Boolean
- Definition Classes
- AbstractCollection → Collection
- def descendingIterator(): Iterator[E]
Returns an iterator over the elements in this deque in reverse sequential order.
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).
The returned iterator is <a href="package-summary.html#Weakly">weakly consistent.
- returns
an iterator over the elements in this deque in reverse order
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def element(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque → Queue
- Exceptions thrown
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def forEach(action: Consumer[_ >: E]): Unit
- Definition Classes
- Iterable
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getFirst(): E
throws NoSuchElementException
throws NoSuchElementException
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def getLast(): E
throws NoSuchElementException
throws NoSuchElementException
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isEmpty(): Boolean
Returns
true
if this collection contains no elements.Returns
true
if this collection contains no elements.- returns
true
if this collection contains no elements
- Definition Classes
- ConcurrentLinkedDeque → AbstractCollection → Collection
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def iterator(): Iterator[E]
Returns an iterator over the elements in this deque in proper sequence.
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).
The returned iterator is <a href="package-summary.html#Weakly">weakly consistent.
- returns
an iterator over the elements in this deque in proper sequence
- Definition Classes
- ConcurrentLinkedDeque → Deque → AbstractCollection → Collection → Iterable
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def offer(e: E): Boolean
Inserts the specified element at the tail of this deque.
Inserts the specified element at the tail of this deque. As the deque is unbounded, this method will never return
false
.- returns
true
(as specified byoffer
) throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque → Queue
- def offerFirst(e: E): Boolean
Inserts the specified element at the front of this deque.
Inserts the specified element at the front of this deque. As the deque is unbounded, this method will never return
false
.- returns
true
(as specified byofferFirst
) throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def offerLast(e: E): Boolean
Inserts the specified element at the end of this deque.
Inserts the specified element at the end of this deque. As the deque is unbounded, this method will never return
false
.This method is equivalent to add().
- returns
true
(as specified byofferLast
) throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def parallelStream(): Stream[E]
- Definition Classes
- Collection
- def peek(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque → Queue
- def peekFirst(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def peekLast(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def poll(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque → Queue
- def pollFirst(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def pollLast(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def pop(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque
- Exceptions thrown
- def push(e: E): Unit
throws NullPointerException
throws NullPointerException
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def remove(o: Any): Boolean
Removes the first occurrence of the specified element from this deque.
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
e
such thato.equals(e)
(if such an element exists). Returnstrue
if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).This method is equivalent to removeFirstOccurrence(Object)}.
- o
element to be removed from this deque, if present
- returns
true
if the deque contained the specified element throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque → AbstractCollection → Collection
- def remove(): E
- Definition Classes
- ConcurrentLinkedDeque → Deque → Queue
- Exceptions thrown
- def removeAll(c: Collection[_]): Boolean
- Definition Classes
- AbstractCollection → Collection
- def removeFirst(): E
throws NoSuchElementException
throws NoSuchElementException
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def removeFirstOccurrence(o: Any): Boolean
Removes the first occurrence of the specified element from this deque.
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
e
such thato.equals(e)
(if such an element exists). Returnstrue
if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).- o
element to be removed from this deque, if present
- returns
true
if the deque contained the specified element throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def removeIf(filter: Predicate[_ >: E]): Boolean
- Definition Classes
- Collection
- def removeLast(): E
throws NoSuchElementException
throws NoSuchElementException
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def removeLastOccurrence(o: Any): Boolean
Removes the last occurrence of the specified element from this deque.
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
e
such thato.equals(e)
(if such an element exists). Returnstrue
if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).- o
element to be removed from this deque, if present
- returns
true
if the deque contained the specified element throws NullPointerException if the specified element is null
- Definition Classes
- ConcurrentLinkedDeque → Deque
- def retainAll(c: Collection[_]): Boolean
- Definition Classes
- AbstractCollection → Collection
- def size(): Int
Returns the number of elements in this deque.
Returns the number of elements in this deque. If this deque contains more than
Integer.MAX_VALUE
elements, it returnsInteger.MAX_VALUE
.Beware that, unlike in most collections, this method is NOT a constant-time operation. Because of the asynchronous nature of these deques, determining the current number of elements requires traversing them all to count them. Additionally, it is possible for the size to change during execution of this method, in which case the returned result will be inaccurate. Thus, this method is typically not very useful in concurrent applications.
- returns
the number of elements in this deque
- Definition Classes
- ConcurrentLinkedDeque → Deque → AbstractCollection → Collection
- def spliterator(): CLDSpliterator[E]
Returns a Spliterator over the elements in this deque.
Returns a Spliterator over the elements in this deque.
The returned spliterator is weakly consistent.
The
Spliterator
reports Spliterator#CONCURRENT, Spliterator#ORDERED, and Spliterator#NONNULL .Implementation Note: The
Spliterator
implementstrySplit
to permit limited parallelism.- returns
a
Spliterator
over the elements in this deque
- Definition Classes
- ConcurrentLinkedDeque → Collection → Iterable
- Since
1.8
- def stream(): Stream[E]
- Definition Classes
- Collection
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toArray[T <: AnyRef](a: Array[T]): Array[T]
Returns an array containing all of the elements in this deque, in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.
Returns an array containing all of the elements in this deque, in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the deque 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 deque.
If this deque fits in the specified array with room to spare (i.e., the array has more elements than this deque), the element in the array immediately following the end of the deque is set to
null
.Like the toArray() method, this method acts as bridge between array-based and collection-based APIs. Further, this method allows precise control over the runtime type of the output array, and may, under certain circumstances, be used to save allocation costs.
Suppose
x
is a deque known to contain only strings. The following code can be used to dump the deque into a newly allocated array ofString
:String[] y = x.toArray(new String[0]);
Note that
toArray(new Object[0])
is identical in function totoArray()
.- a
the array into which the elements of the deque are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose
- returns
an array containing all of the elements in this deque throws ArrayStoreException if the runtime type of the specified array is not a supertype of the runtime type of every element in this deque throws NullPointerException if the specified array is null
- Definition Classes
- ConcurrentLinkedDeque → AbstractCollection → Collection
- def toArray(): Array[AnyRef]
Returns an array containing all of the elements in this deque, in proper sequence (from first to last element).
Returns an array containing all of the elements in this deque, in proper sequence (from first to last element).
The returned array will be "safe" in that no references to it are maintained by this deque. (In other words, this method must allocate a new array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
- returns
an array containing all of the elements in this deque
- Definition Classes
- ConcurrentLinkedDeque → AbstractCollection → Collection
- def toString(): String
- Definition Classes
- ConcurrentLinkedDeque → AbstractCollection → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()