Condividi tramite


ConcurrentLinkedDeque Class

Definition

An unbounded concurrent Deque deque based on linked nodes.

[Android.Runtime.Register("java/util/concurrent/ConcurrentLinkedDeque", DoNotGenerateAcw=true)]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
public class ConcurrentLinkedDeque : Java.Util.AbstractCollection, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Util.IDeque
[<Android.Runtime.Register("java/util/concurrent/ConcurrentLinkedDeque", DoNotGenerateAcw=true)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "E" })>]
type ConcurrentLinkedDeque = class
    inherit AbstractCollection
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IDeque
    interface IQueue
    interface ICollection
    interface IIterable
Inheritance
ConcurrentLinkedDeque
Attributes
Implements

Remarks

An unbounded concurrent Deque deque based on linked nodes. Concurrent insertion, removal, and access operations execute safely across multiple threads. A ConcurrentLinkedDeque is an appropriate choice when many threads will share access to a common collection. Like most other concurrent collection implementations, this class does not permit the use of null elements.

Iterators and spliterators are <i>weakly consistent</i>.

Beware that, unlike in most collections, the size method is <em>NOT</em> a constant-time operation. Because of the asynchronous nature of these deques, determining the current number of elements requires a traversal of the elements, and so may report inaccurate results if this collection is modified during traversal.

Bulk operations that add, remove, or examine multiple elements, such as #addAll, #removeIf or #forEach, are <em>not</em> guaranteed to be performed atomically. For example, a forEach traversal concurrent with an addAll operation might observe only some of the added elements.

This class and its iterator implement all of the <em>optional</em> methods of the Deque and Iterator interfaces.

Memory consistency effects: As with other concurrent collections, actions in a thread prior to placing an object into a ConcurrentLinkedDeque<i>happen-before</i> actions subsequent to the access or removal of that element from the ConcurrentLinkedDeque in another thread.

This class is a member of the Java Collections Framework.

Added in 1.7.

Java documentation for java.util.concurrent.ConcurrentLinkedDeque.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

ConcurrentLinkedDeque()

Constructs an empty deque.

ConcurrentLinkedDeque(ICollection)

Constructs a deque initially containing the elements of the given collection, added in traversal order of the collection's iterator.

ConcurrentLinkedDeque(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
First

Retrieves, but does not remove, the first element of this deque.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsEmpty

To be added

(Inherited from AbstractCollection)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Last

Retrieves, but does not remove, the last element of this deque.

PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Add(Object)

To be added

(Inherited from AbstractCollection)
AddAll(ICollection)

To be added

(Inherited from AbstractCollection)
AddFirst(Object)

Inserts the specified element at the front of this deque.

AddLast(Object)

Inserts the specified element at the end of this deque.

Clear()

To be added

(Inherited from AbstractCollection)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Contains(Object)

To be added

(Inherited from AbstractCollection)
ContainsAll(ICollection)

To be added

(Inherited from AbstractCollection)
DescendingIterator()

Returns an iterator over the elements in this deque in reverse sequential order.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Element()

Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque).

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
ForEach(IConsumer)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
Iterator()

Returns an iterator over the elements in this deque in proper sequence.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Offer(Object)

Inserts the specified element at the tail of this deque.

OfferFirst(Object)

Inserts the specified element at the front of this deque.

OfferLast(Object)

Inserts the specified element at the end of this deque.

Peek()

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.

PeekFirst()

Retrieves, but does not remove, the first element of this deque, or returns null if this deque is empty.

PeekLast()

Retrieves, but does not remove, the last element of this deque, or returns null if this deque is empty.

Poll()

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.

PollFirst()

Retrieves and removes the first element of this deque, or returns null if this deque is empty.

PollLast()

Retrieves and removes the last element of this deque, or returns null if this deque is empty.

Pop()

Pops an element from the stack represented by this deque.

Push(Object)
Remove()

Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque).

Remove(Object)

To be added

(Inherited from AbstractCollection)
RemoveAll(ICollection)

To be added

(Inherited from AbstractCollection)
RemoveFirst()

Retrieves and removes the first element of this deque.

RemoveFirstOccurrence(Object)

Removes the first occurrence of the specified element from this deque.

RemoveIf(IPredicate)
RemoveLast()

Retrieves and removes the last element of this deque.

RemoveLastOccurrence(Object)

Removes the last occurrence of the specified element from this deque.

RetainAll(ICollection)

To be added

(Inherited from AbstractCollection)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Size()

Returns the number of elements in this deque.

Spliterator()

Returns a Spliterator over the elements in this deque.

ToArray()

To be added

(Inherited from AbstractCollection)
ToArray(Object[])

To be added

(Inherited from AbstractCollection)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)
ToEnumerable(IIterable)
ToEnumerable<T>(IIterable)

Applies to