語言

Set.CopyOf(ICollection) 方法

定義

警告

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

回傳一個不可修改的集合,包含給定集合的元素。

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

參數

coll
ICollection

Collection從 A 中抽取元素,必須是非零

傳回

包含給定元素的 a SetCollection

屬性

備註

回傳一個不可修改的集合,包含給定集合的元素。 給定的集合不得為空,且不得包含任何空元素。 若給定集合包含重複元素,則保留重複元素中的任意元素。 若該集合後來被修改,回傳的集合將不會反映這些修改。

加了10。

Java 文件 java.util.Set.copyOf(java.util.Collection<? extends E>)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於