共用方式為


IBlockingDeque.OfferLast Method

Definition

Overloads

OfferLast(Object)

Inserts the specified element at the end 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.

OfferLast(Object, Int64, TimeUnit)

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

OfferLast(Object)

Inserts the specified element at the end 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("offerLast", "(Ljava/lang/Object;)Z", "GetOfferLast_Ljava_lang_Object_Handler:Java.Util.Concurrent.IBlockingDequeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OfferLast (Java.Lang.Object? e);
[<Android.Runtime.Register("offerLast", "(Ljava/lang/Object;)Z", "GetOfferLast_Ljava_lang_Object_Handler:Java.Util.Concurrent.IBlockingDequeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OfferLast : Java.Lang.Object -> bool

Parameters

e
Object

the element to add

Returns

Implements

Attributes

Remarks

Inserts the specified element at the end 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 #addLast(Object) addLast method, which can fail to insert an element only by throwing an exception.

Java documentation for java.util.concurrent.BlockingDeque.offerLast(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

OfferLast(Object, Int64, TimeUnit)

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

[Android.Runtime.Register("offerLast", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetOfferLast_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 OfferLast (Java.Lang.Object? e, long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("offerLast", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetOfferLast_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 OfferLast : 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 end of this deque, waiting up to the specified wait time if necessary for space to become available.

Java documentation for java.util.concurrent.BlockingDeque.offerLast(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