次の方法で共有


IBlockingDeque.OfferFirst Method

Definition

Overloads

OfferFirst(Object)

Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.

OfferFirst(Object, Int64, TimeUnit)

Inserts the specified element at the front of this deque, waiting up to the specified wait time if necessary for space to become available.

OfferFirst(Object)

Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.

[Android.Runtime.Register("offerFirst", "(Ljava/lang/Object;)Z", "GetOfferFirst_Ljava_lang_Object_Handler:Java.Util.Concurrent.IBlockingDequeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OfferFirst (Java.Lang.Object? e);
[<Android.Runtime.Register("offerFirst", "(Ljava/lang/Object;)Z", "GetOfferFirst_Ljava_lang_Object_Handler:Java.Util.Concurrent.IBlockingDequeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OfferFirst : Java.Lang.Object -> bool

Parameters

e
Object

the element to add

Returns

Implements

Attributes

Remarks

Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available. When using a capacity-restricted deque, this method is generally preferable to the #addFirst(Object) addFirst method, which can fail to insert an element only by throwing an exception.

Java documentation for java.util.concurrent.BlockingDeque.offerFirst(E).

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.

Applies to

OfferFirst(Object, Int64, TimeUnit)

Inserts the specified element at the front of this deque, waiting up to the specified wait time if necessary for space to become available.

[Android.Runtime.Register("offerFirst", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetOfferFirst_Ljava_lang_Object_JLjava_util_concurrent_TimeUnit_Handler:Java.Util.Concurrent.IBlockingDequeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OfferFirst (Java.Lang.Object? e, long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("offerFirst", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetOfferFirst_Ljava_lang_Object_JLjava_util_concurrent_TimeUnit_Handler:Java.Util.Concurrent.IBlockingDequeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OfferFirst : Java.Lang.Object * int64 * Java.Util.Concurrent.TimeUnit -> bool

Parameters

e
Object

the element to add

timeout
Int64

how long to wait before giving up, in units of unit

unit
TimeUnit

a TimeUnit determining how to interpret the timeout parameter

Returns

true if successful, or false if the specified waiting time elapses before space is available

Attributes

Remarks

Inserts the specified element at the front of this deque, waiting up to the specified wait time if necessary for space to become available.

Java documentation for java.util.concurrent.BlockingDeque.offerFirst(E, long, java.util.concurrent.TimeUnit).

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.

Applies to