Share via


ICollection.RetainAll(ICollection) Method

Definition

Retains only the elements in this collection that are contained in the specified collection (optional operation).

[Android.Runtime.Register("retainAll", "(Ljava/util/Collection;)Z", "GetRetainAll_Ljava_util_Collection_Handler:Java.Util.ICollectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool RetainAll (System.Collections.ICollection c);
[<Android.Runtime.Register("retainAll", "(Ljava/util/Collection;)Z", "GetRetainAll_Ljava_util_Collection_Handler:Java.Util.ICollectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member RetainAll : System.Collections.ICollection -> bool

Parameters

c
ICollection

collection containing elements to be retained in this collection

Returns

true if this collection changed as a result of the call

Attributes

Remarks

Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.

Java documentation for java.util.Collection.retainAll(java.util.Collection<?>).

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