Udostępnij za pośrednictwem


IQueue.Offer(Object) Method

Definition

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

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

Parameters

e
Object

the element to add

Returns

true if the element was added to this queue, else false

Attributes

Remarks

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted queue, this method is generally preferable to #add, which can fail to insert an element only by throwing an exception.

Java documentation for java.util.Queue.offer(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