LinkedBlockingDeque Class

Definition

An optionally-bounded BlockingDeque blocking deque based on linked nodes.

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

Remarks

An optionally-bounded BlockingDeque blocking deque based on linked nodes.

The optional capacity bound constructor argument serves as a way to prevent excessive expansion. The capacity, if unspecified, is equal to Integer#MAX_VALUE. Linked nodes are dynamically created upon each insertion unless this would bring the deque above capacity.

Most operations run in constant time (ignoring time spent blocking). Exceptions include #remove(Object) remove, #removeFirstOccurrence removeFirstOccurrence, #removeLastOccurrence removeLastOccurrence, #contains contains, #iterator iterator.remove(), and the bulk operations, all of which run in linear time.

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

This class is a member of the Java Collections Framework.

Added in 1.6.

Java documentation for java.util.concurrent.LinkedBlockingDeque.

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

LinkedBlockingDeque()

Creates a LinkedBlockingDeque with a capacity of Integer#MAX_VALUE.

LinkedBlockingDeque(ICollection)

Creates a LinkedBlockingDeque with a capacity of Integer#MAX_VALUE, initially containing the elements of the given collection, added in traversal order of the collection's iterator.

LinkedBlockingDeque(Int32)

Creates a LinkedBlockingDeque with the given (fixed) capacity.

LinkedBlockingDeque(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)
AddLast(Object)
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)
DrainTo(ICollection)
DrainTo(ICollection, Int32)
Element()

Retrieves, but does not remove, the head of this queue.

(Inherited from AbstractQueue)
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)
Offer(Object, Int64, TimeUnit)
OfferFirst(Object)
OfferFirst(Object, Int64, TimeUnit)
OfferLast(Object)
OfferLast(Object, Int64, TimeUnit)
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.

Poll(Int64, TimeUnit)
PollFirst()

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

PollFirst(Int64, TimeUnit)

Retrieves and removes the first element of this deque, waiting up to the specified wait time if necessary for an element to become available.

PollLast()

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

PollLast(Int64, TimeUnit)

Retrieves and removes the last element of this deque, waiting up to the specified wait time if necessary for an element to become available.

Pop()

Pops an element from the stack represented by this deque.

Push(Object)
Put(Object)
PutFirst(Object)
PutLast(Object)
RemainingCapacity()

Returns the number of additional elements that this deque can ideally (in the absence of memory or resource constraints) accept without blocking.

Remove()

Retrieves and removes the head of this queue.

(Inherited from AbstractQueue)
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.

Take()

Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), waiting if necessary until an element becomes available.

TakeFirst()

Retrieves and removes the first element of this deque, waiting if necessary until an element becomes available.

TakeLast()

Retrieves and removes the last element of this deque, waiting if necessary until an element becomes available.

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)

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, 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)

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)
OfferFirstAsync(IBlockingDeque, Object)
OfferFirstAsync(IBlockingDeque, Object, Int64, TimeUnit)
OfferLastAsync(IBlockingDeque, Object)
OfferLastAsync(IBlockingDeque, Object, Int64, TimeUnit)
PollFirstAsync(IBlockingDeque, Int64, TimeUnit)
PollLastAsync(IBlockingDeque, Int64, TimeUnit)
PutFirstAsync(IBlockingDeque, Object)
PutLastAsync(IBlockingDeque, Object)
TakeFirstAsync(IBlockingDeque)
TakeLastAsync(IBlockingDeque)
OfferAsync(IBlockingQueue, Object)
OfferAsync(IBlockingQueue, Object, Int64, TimeUnit)
PollAsync(IBlockingQueue, Int64, TimeUnit)
PutAsync(IBlockingQueue, Object)
TakeAsync(IBlockingQueue)
ToEnumerable(IIterable)
ToEnumerable<T>(IIterable)

Applies to