ISet<T> 接口

定义

提供用于集的抽象的基接口。Provides the base interface for the abstraction of sets.

generic <typename T>
public interface class ISet : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>
public interface ISet<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>
type ISet<'T> = interface
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
Public Interface ISet(Of T)
Implements ICollection(Of T), IEnumerable(Of T)

类型参数

T

集内元素的类型。The type of elements in the set.

派生
实现

注解

此接口提供用于实现集合的方法,这些方法是具有唯一元素和特定操作的集合。This interface provides methods for implementing sets, which are collections that have unique elements and specific operations. @No__t 0 和 @no__t 1 集合实现此接口。The HashSet<T> and SortedSet<T> collections implement this interface.

属性

Count

获取 ICollection<T> 中包含的元素数。Gets the number of elements contained in the ICollection<T>.

(继承自 ICollection<T>)
IsReadOnly

获取一个值,该值指示 ICollection<T> 是否为只读。Gets a value indicating whether the ICollection<T> is read-only.

(继承自 ICollection<T>)

方法

Add(T)

向当前集内添加元素,并返回一个指示是否已成功添加元素的值。Adds an element to the current set and returns a value to indicate if the element was successfully added.

Clear()

ICollection<T> 中移除所有项。Removes all items from the ICollection<T>.

(继承自 ICollection<T>)
Contains(T)

确定 ICollection<T> 是否包含特定值。Determines whether the ICollection<T> contains a specific value.

(继承自 ICollection<T>)
CopyTo(T[], Int32)

从特定的 ICollection<T> 索引开始,将 Array 的元素复制到一个 Array 中。Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

(继承自 ICollection<T>)
ExceptWith(IEnumerable<T>)

从当前集内移除指定集合中的所有元素。Removes all elements in the specified collection from the current set.

GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

(继承自 IEnumerable)
IntersectWith(IEnumerable<T>)

修改当前集,使该集仅包含也存在在指定集合中的元素。Modifies the current set so that it contains only elements that are also in a specified collection.

IsProperSubsetOf(IEnumerable<T>)

确定当前集是否为指定集合的真(严格)子集。Determines whether the current set is a proper (strict) subset of a specified collection.

IsProperSupersetOf(IEnumerable<T>)

确定当前集是否为指定集合的真(严格)超集。Determines whether the current set is a proper (strict) superset of a specified collection.

IsSubsetOf(IEnumerable<T>)

确定一个集是否为指定集合的子集。Determines whether a set is a subset of a specified collection.

IsSupersetOf(IEnumerable<T>)

确定当前集是否为指定集合的超集。Determines whether the current set is a superset of a specified collection.

Overlaps(IEnumerable<T>)

确定当前集是否与指定的集合重叠。Determines whether the current set overlaps with the specified collection.

Remove(T)

ICollection<T> 中移除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the ICollection<T>.

(继承自 ICollection<T>)
SetEquals(IEnumerable<T>)

确定当前集与指定的集合是否包含相同的元素。Determines whether the current set and the specified collection contain the same elements.

SymmetricExceptWith(IEnumerable<T>)

修改当前集,使该集仅包含存在于当前集或指定集合中的元素(但不同时存在于两者中)。Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.

UnionWith(IEnumerable<T>)

修改当前集,使该集包含存在于当前集、指定集合或两者中的所有元素。Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both.

扩展方法

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个节点的上级。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个节点的上级。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

返回源集合中每个元素和文档的子元素的集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

返回源集合中经过筛选的每个元素和文档的子元素集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

返回节点集合(其中包含源集合中的所有节点),并按文档顺序排列。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于