Set.CopyOf(ICollection) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
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
从中绘制元素的 a Collection
,必须为非 null
返回
包含 Set
给定元素的 Collection
- 属性
注解
返回包含给定集合的元素的不可修改集。 给定的集合不得为 null,并且不能包含任何 null 元素。 如果给定的集合包含重复元素,则会保留重复项的任意元素。 如果随后修改给定的集合,则返回的 Set 将不会反映此类修改。
已在 10 中添加。
适用于 . 的 java.util.Set.copyOf(java.util.Collection<? extends E>)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。