Share via


CopyOnWriteArrayList.Add Method

Definition

Overloads

Add(Object)

Appends the specified element to the end of this list.

Add(Int32, Object)

Inserts the specified element at the specified position in this list.

Add(Object)

Appends the specified element to the end of this list.

[Android.Runtime.Register("add", "(Ljava/lang/Object;)Z", "GetAdd_Ljava_lang_Object_Handler")]
public virtual bool Add (Java.Lang.Object? e);
[<Android.Runtime.Register("add", "(Ljava/lang/Object;)Z", "GetAdd_Ljava_lang_Object_Handler")>]
abstract member Add : Java.Lang.Object -> bool
override this.Add : Java.Lang.Object -> bool

Parameters

e
Object

element to be appended to this list

Returns

true (as specified by Collection#add)

Implements

Attributes

Remarks

Appends the specified element to the end of this list.

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

Add(Int32, Object)

Inserts the specified element at the specified position in this list.

[Android.Runtime.Register("add", "(ILjava/lang/Object;)V", "GetAdd_ILjava_lang_Object_Handler")]
public virtual void Add (int index, Java.Lang.Object? element);
[<Android.Runtime.Register("add", "(ILjava/lang/Object;)V", "GetAdd_ILjava_lang_Object_Handler")>]
abstract member Add : int * Java.Lang.Object -> unit
override this.Add : int * Java.Lang.Object -> unit

Parameters

index
Int32
element
Object

Implements

Attributes

Remarks

Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Java documentation for java.util.concurrent.CopyOnWriteArrayList.add(int, 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