Share via


DelayQueue Class

Definition

An unbounded BlockingQueue blocking queue of Delayed elements, in which an element can only be taken when its delay has expired.

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

Remarks

An unbounded BlockingQueue blocking queue of Delayed elements, in which an element can only be taken when its delay has expired. The <em>head</em> of the queue is that Delayed element whose delay expired furthest in the past. If no delay has expired there is no head and poll will return null. Expiration occurs when an element's getDelay(TimeUnit.NANOSECONDS) method returns a value less than or equal to zero. Even though unexpired elements cannot be removed using take or poll, they are otherwise treated as normal elements. For example, the size method returns the count of both expired and unexpired elements. This queue does not permit null elements.

This class and its iterator implement all of the <em>optional</em> methods of the Collection and Iterator interfaces. The Iterator provided in method #iterator() is <em>not</em> guaranteed to traverse the elements of the DelayQueue in any particular order.

This class is a member of the Java Collections Framework.

Added in 1.5.

Java documentation for java.util.concurrent.DelayQueue.

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

DelayQueue()

Creates a new DelayQueue that is initially empty.

DelayQueue(ICollection)

Creates a DelayQueue initially containing the elements of the given collection of Delayed instances.

DelayQueue(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)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsEmpty

To be added

(Inherited from AbstractCollection)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
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)
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)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
DrainTo(ICollection, Int32)
DrainTo(ICollection)
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)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
Iterator()

Returns an iterator over all the elements (both expired and unexpired) in this queue.

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

Inserts the specified element into this delay queue.

Offer(Object)

Inserts the specified element into this delay queue.

Peek()

Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.

Poll()

Retrieves and removes the head of this queue, or returns null if this queue has no elements with an expired delay.

Poll(Int64, TimeUnit)

Retrieves and removes the head of this queue, or returns null if this queue has no elements with an expired delay.

Put(Object)

Inserts the specified element into this delay queue.

RemainingCapacity()

Always returns Integer.MAX_VALUE because a DelayQueue is not capacity constrained.

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)
RetainAll(ICollection)

To be added

(Inherited from AbstractCollection)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Size()

Returns a count of how many objects this Collection contains.

Take()

Retrieves and removes the head of this queue, waiting if necessary until an element with an expired delay is available on this queue.

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)
OfferAsync(IBlockingQueue, Object, Int64, TimeUnit)
OfferAsync(IBlockingQueue, Object)
PollAsync(IBlockingQueue, Int64, TimeUnit)
PutAsync(IBlockingQueue, Object)
TakeAsync(IBlockingQueue)
ToEnumerable(IIterable)
ToEnumerable<T>(IIterable)

Applies to