ImmutableSortedSet<T>.Builder ImmutableSortedSet<T>.Builder ImmutableSortedSet<T>.Builder ImmutableSortedSet<T>.Builder Class

定义

表示一个只需少量或者无需内存分配就能启用更改,并且可以有效地操作或生成不可变排序集的排序集。Represents a sorted set that enables changes with little or no memory allocations, and efficiently manipulates or builds immutable sorted sets.

NuGet 包System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

public: ref class ImmutableSortedSet<T>::Builder sealed : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::Generic::ISet<T>, System::Collections::ICollection
public sealed class ImmutableSortedSet<T>.Builder : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.ISet<T>, System.Collections.ICollection
type ImmutableSortedSet<'T>.Builder = class
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyCollection<'T>
    interface ISet<'T>
    interface ICollection
Public NotInheritable Class ImmutableSortedSet(Of T).Builder
Implements ICollection, ICollection(Of T), IEnumerable(Of T), IReadOnlyCollection(Of T), ISet(Of T)

类型参数

T
继承
ImmutableSortedSet<T>.BuilderImmutableSortedSet<T>.BuilderImmutableSortedSet<T>.BuilderImmutableSortedSet<T>.Builder
实现

注解

尽管 @no__t 0 和其他方法已为集合提供快速的批量更改操作,但 @no__t 1 类启用了对具有相同或更高效率的集进行多个更改的组合,具体取决于操作。Although ImmutableSortedSet<T>.Union and other methods already provide fast bulk change operations on a collection, the ImmutableSortedSet<T>.Builder class enables multiple combinations of changes to be made to a set with equal or greater efficiency, depending on the operation.

属性

Count Count Count Count

获取不可变排序集内的元素数。Gets the number of elements in the immutable sorted set.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取给定索引的集元素。Gets the element of the set at the given index.

KeyComparer KeyComparer KeyComparer KeyComparer

获取或设置用于确定不可变排序集内的值是否相等的对象。Gets or sets the object that is used to determine equality for the values in the immutable sorted set.

Max Max Max Max

根据比较器的定义,获取不可变排序集内的最大值。Gets the maximum value in the immutable sorted set, as defined by the comparer.

Min Min Min Min

根据比较器的定义,获取不可变排序集内的最小值。Gets the minimum value in the immutable sorted set, as defined by the comparer.

方法

Add(T) Add(T) Add(T) Add(T)

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

Clear() Clear() Clear() Clear()

从此集内移除所有元素。Removes all elements from this set.

Contains(T) Contains(T) Contains(T) Contains(T)

确定集是否包含指定的对象。Determines whether the set contains the specified object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExceptWith(IEnumerable<T>) ExceptWith(IEnumerable<T>) ExceptWith(IEnumerable<T>) ExceptWith(IEnumerable<T>)

从当前集内移除指定的项集。Removes the specified set of items from the current set.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回循环访问集的枚举器。Returns an enumerator that iterates through the set.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IntersectWith(IEnumerable<T>) IntersectWith(IEnumerable<T>) IntersectWith(IEnumerable<T>) IntersectWith(IEnumerable<T>)

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

IsProperSubsetOf(IEnumerable<T>) IsProperSubsetOf(IEnumerable<T>) IsProperSubsetOf(IEnumerable<T>) IsProperSubsetOf(IEnumerable<T>)

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

IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>)

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

IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>)

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

IsSupersetOf(IEnumerable<T>) IsSupersetOf(IEnumerable<T>) IsSupersetOf(IEnumerable<T>) IsSupersetOf(IEnumerable<T>)

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

ItemRef(Int32) ItemRef(Int32) ItemRef(Int32) ItemRef(Int32)

获取对给定 index 处的集元素的只读引用。Gets a read-only reference to the element of the set at the given index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>)

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

Remove(T) Remove(T) Remove(T) Remove(T)

从集内移除指定对象的第一个匹配项。Removes the first occurrence of the specified object from the set.

Reverse() Reverse() Reverse() Reverse()

返回一个枚举器,该枚举器按逆序循环访问不可变排序集。Returns an enumerator that iterates over the immutable sorted set in reverse order.

SetEquals(IEnumerable<T>) SetEquals(IEnumerable<T>) SetEquals(IEnumerable<T>) SetEquals(IEnumerable<T>)

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

SymmetricExceptWith(IEnumerable<T>) SymmetricExceptWith(IEnumerable<T>) SymmetricExceptWith(IEnumerable<T>) 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.

ToImmutable() ToImmutable() ToImmutable() ToImmutable()

基于此实例的内容创建一个不可变排序集。Creates an immutable sorted set based on the contents of this instance.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
UnionWith(IEnumerable<T>) UnionWith(IEnumerable<T>) UnionWith(IEnumerable<T>) UnionWith(IEnumerable<T>)

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

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

从特定的数组索引开始,将集的元素复制到一个数组中。Copies the elements of the set to an array, starting at a particular array index.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。Gets a value that indicates whether access to the ICollection is synchronized (thread-safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

获取可用于同步对 ICollection 的访问的对象。Gets an object that can be used to synchronize access to the ICollection.

ICollection<T>.Add(T) ICollection<T>.Add(T) ICollection<T>.Add(T) ICollection<T>.Add(T)

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

ICollection<T>.CopyTo(T[], Int32) ICollection<T>.CopyTo(T[], Int32) ICollection<T>.CopyTo(T[], Int32) ICollection<T>.CopyTo(T[], Int32)

从特定的数组索引开始,将集合的元素复制到数组中。Copies the elements of the collection to an array, starting at a particular array index.

ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly

获取一个值,该值指示此实例是否为只读。Gets a value that indicates whether this instance is read-only.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

返回一个循环访问集合的枚举器。Returns an enumerator that iterates through the collection.

IEnumerable<T>.GetEnumerator() IEnumerable<T>.GetEnumerator() IEnumerable<T>.GetEnumerator() IEnumerable<T>.GetEnumerator()

返回一个循环访问集合的枚举器。Returns an enumerator that iterates through the collection.

扩展方法

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) 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) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) 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) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) 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) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

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

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) 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) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) 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>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

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

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) 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) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) 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>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) 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) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) 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>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) 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>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

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

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

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

适用于