Udostępnij za pośrednictwem


List.CopyOf(ICollection) Method

Definition

Caution

Use 'Java.Util.IList.CopyOf'. This class will be removed in a future release.

Returns an unmodifiable List containing the elements of the given Collection, in its iteration order.

[Android.Runtime.Register("copyOf", "(Ljava/util/Collection;)Ljava/util/List;", "", ApiSince=31)]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
[System.Obsolete("Use 'Java.Util.IList.CopyOf'. This class will be removed in a future release.")]
public static System.Collections.IList CopyOf (System.Collections.ICollection coll);
[<Android.Runtime.Register("copyOf", "(Ljava/util/Collection;)Ljava/util/List;", "", ApiSince=31)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "E" })>]
[<System.Obsolete("Use 'Java.Util.IList.CopyOf'. This class will be removed in a future release.")>]
static member CopyOf : System.Collections.ICollection -> System.Collections.IList

Parameters

coll
ICollection

a Collection from which elements are drawn, must be non-null

Returns

a List containing the elements of the given Collection

Attributes

Remarks

Returns an unmodifiable List containing the elements of the given Collection, in its iteration order. The given Collection must not be null, and it must not contain any null elements. If the given Collection is subsequently modified, the returned List will not reflect such modifications.

Added in 10.

Java documentation for java.util.List.copyOf(java.util.Collection<? extends 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