DelayQueue Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An unbounded BlockingQueue blocking queue of Delayed
elements, in which an element generally becomes eligible for removal 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 generally becomes eligible for removal when its delay has expired.
"expired">An element is considered <em>expired</em> when its <c>getDelay(TimeUnit.NANOSECONDS)</c> method would return a value less than or equal to zero.
"head">An element is considered the <em>head</em> of the queue if it is the element with the earliest expiration time, whether in the past or the future, if there is such an element.
"expired-head">An element is considered the <em>expired head</em> of the queue if it is the <em>expired</em> element with the earliest expiration time in the past, if there is such an element. The <em>expired head</em>, when present, is also the <em>head</em>.
While this class implements the BlockingQueue
interface, it intentionally violates the general contract of BlockingQueue
, in that the following methods disregard the presence of unexpired elements and only ever remove the <em>expired head</em>:
<ul> <li> #poll()
<li> #poll(long,TimeUnit)
<li> #take()
<li> #remove()
</ul>
All other methods operate on both expired and unexpired elements. For example, the #size()
method returns the count of all elements. Method #peek()
may return the (non-null) <em>head</em> even when take()
would block waiting for that element to expire.
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(ICollection) |
Creates a |
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 |
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 |
Poll() |
Retrieves and removes the head of this queue, or returns |
Poll(Int64, TimeUnit) |
Retrieves and removes the head of this queue, or returns |
Put(Object) |
Inserts the specified element into this delay queue. |
RemainingCapacity() |
Always returns |
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 |
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) |
Gets the JNI name of the type of the instance |
JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |
OfferAsync(IBlockingQueue, Object, Int64, TimeUnit) | |
OfferAsync(IBlockingQueue, Object) | |
PollAsync(IBlockingQueue, Int64, TimeUnit) | |
PutAsync(IBlockingQueue, Object) | |
TakeAsync(IBlockingQueue) | |
ToEnumerable(IIterable) | |
ToEnumerable<T>(IIterable) |