CopyOnWriteArrayList.Remove Method
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.
Overloads
Remove(Object) |
Removes the first occurrence of the specified element from this list, if it is present. |
Remove(Int32) |
Removes the element at the specified position in this list. |
Remove(Object)
Removes the first occurrence of the specified element from this list, if it is present.
[Android.Runtime.Register("remove", "(Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Handler")]
public virtual bool Remove (Java.Lang.Object? o);
[<Android.Runtime.Register("remove", "(Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Handler")>]
abstract member Remove : Java.Lang.Object -> bool
override this.Remove : Java.Lang.Object -> bool
Parameters
- o
- Object
element to be removed from this list, if present
Returns
true
if this list contained the specified element
Implements
- Attributes
Remarks
Removes the first occurrence of the specified element from this list, if it is present. If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i
such that Objects.equals(o, get(i))
(if such an element exists). Returns true
if this list contained the specified element (or equivalently, if this list changed as a result of the call).
Java documentation for java.util.concurrent.CopyOnWriteArrayList.remove(java.lang.Object)
.
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
Remove(Int32)
Removes the element at the specified position in this list.
[Android.Runtime.Register("remove", "(I)Ljava/lang/Object;", "GetRemove_IHandler")]
public virtual Java.Lang.Object? Remove (int index);
[<Android.Runtime.Register("remove", "(I)Ljava/lang/Object;", "GetRemove_IHandler")>]
abstract member Remove : int -> Java.Lang.Object
override this.Remove : int -> Java.Lang.Object
Parameters
- index
- Int32
the index of the object to remove.
Returns
Implements
- Attributes
Remarks
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
Java documentation for java.util.concurrent.CopyOnWriteArrayList.remove(int)
.
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.