ImmutableHashSet<T> ImmutableHashSet<T> ImmutableHashSet<T> ImmutableHashSet<T> Class

定義

代表不可變、未排序的雜湊集。Represents an immutable, unordered hash set.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

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

類型參數

T

雜湊集中項目的類型。The type of elements in the hash set.

繼承
ImmutableHashSet<T>ImmutableHashSet<T>ImmutableHashSet<T>ImmutableHashSet<T>
實作

欄位

Empty Empty Empty Empty

取得此類型的不可變雜湊集,此不可變雜湊集使用預設的 IEqualityComparer<T>Gets an immutable hash set for this type that uses the default IEqualityComparer<T>.

屬性

Count Count Count Count

取得不可變雜湊集中的項目數目。Gets the number of elements in the immutable hash set.

IsEmpty IsEmpty IsEmpty IsEmpty

取得值,這個值指出目前的不可變雜湊集是否為空白。Gets a value that indicates whether the current immutable hash set is empty.

KeyComparer KeyComparer KeyComparer KeyComparer

取得物件,此物件用來取得索引鍵的雜湊程式碼,並檢查不可變雜湊集中的值是否相等。Gets the object that is used to obtain hash codes for the keys and to check the equality of values in the immutable hash set.

方法

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

將指定的項目加入至雜湊集。Adds the specified element to the hash set.

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

擷取空白不可變雜湊集,這個雜湊集的排序及順序語意與這個執行個體相同。Retrieves an empty immutable hash set that has the same sorting and ordering semantics as this instance.

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

判斷此不可變雜湊集是否包含指定的項目。Determines whether this immutable hash set contains the specified element.

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

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

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

從目前的不可變雜湊集,移除指定集合中的項目。Removes the elements in the specified collection from the current immutable hash set.

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

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through the collection.

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

建立不可變雜湊集,其中包含存在於這個資料集和指定之資料集中的項目。Creates an immutable hash set that contains elements that exist in both this set and the specified set.

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

判斷目前的不可變雜湊集是否為指定之集合的適當 (嚴格) 子集。Determines whether the current immutable hash 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 immutable hash 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 immutable hash set is a subset of a specified collection.

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

判斷目前的不可變雜湊集是否為指定之集合的超集。Determines whether the current immutable hash set is a superset of a specified collection.

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

建立目前 Object 的淺層複本 (Shallow Copy)。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 immutable hash set overlaps with the specified collection.

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

從這個不可變雜湊集中移除指定的項目。Removes the specified element from this immutable hash set.

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

判斷目前的不可變雜湊集和指定的集合是否包含相同項目。Determines whether the current immutable hash set and the specified collection contain the same elements.

SymmetricExcept(IEnumerable<T>) SymmetricExcept(IEnumerable<T>) SymmetricExcept(IEnumerable<T>) SymmetricExcept(IEnumerable<T>)

建立不可變雜湊集,其中僅包含在目前資料集或指定之集合 (但非兩者) 中出現的項目。Creates an immutable hash set that contains only elements that are present either in the current set or in the specified collection, but not both.

ToBuilder() ToBuilder() ToBuilder() ToBuilder()

建立與此資料集 (能夠使用標準變動介面,有效率地跨多個作業進行變動) 內容相同的不可變雜湊集。Creates an immutable hash set that has the same contents as this set and can be efficiently mutated across multiple operations by using standard mutable interfaces.

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

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
TryGetValue(T, T) TryGetValue(T, T) TryGetValue(T, T) TryGetValue(T, T)

搜尋指定值的資料集,並傳回所找到的相等值 (如果有的話)。Searches the set for a given value and returns the equal value it finds, if any.

Union(IEnumerable<T>) Union(IEnumerable<T>) Union(IEnumerable<T>) Union(IEnumerable<T>)

建立新的不可變雜湊集,其中包含在目前資料集或指定之集合中出現的所有項目。Creates a new immutable hash set that contains all elements that are present in either the current set or in the specified collection.

WithComparer(IEqualityComparer<T>) WithComparer(IEqualityComparer<T>) WithComparer(IEqualityComparer<T>) WithComparer(IEqualityComparer<T>)

取得不可變雜湊集的執行個體,此不可變雜湊集為其搜尋方法使用指定的相等比較子。Gets an instance of the immutable hash set that uses the specified equality comparer for its search methods.

明確介面實作

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 index.

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

請參閱 ICollection 介面。See the ICollection interface.

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

請參閱 ICollectionSee ICollection.

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

將項目加入至資料集。Adds an item to the set.

ICollection<T>.Clear() ICollection<T>.Clear() ICollection<T>.Clear() ICollection<T>.Clear()

將所有項目從這個資料集移除。Removes all items from this set.

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 set to an array, starting at a particular index.

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

請參閱 ICollection<T> 介面。See the ICollection<T> interface.

ICollection<T>.Remove(T) ICollection<T>.Remove(T) ICollection<T>.Remove(T) ICollection<T>.Remove(T)

從資料集中移除第一個出現的特定物件。Removes the first occurrence of a specific object from the set.

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

傳回逐一查看資料集的列舉程式。Returns an enumerator that iterates through a set.

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

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through the collection.

IImmutableSet<T>.Add(T) IImmutableSet<T>.Add(T) IImmutableSet<T>.Add(T) IImmutableSet<T>.Add(T)

將指定的項目加入至這個不可變的資料集中。Adds the specified element to this immutable set.

IImmutableSet<T>.Clear() IImmutableSet<T>.Clear() IImmutableSet<T>.Clear() IImmutableSet<T>.Clear()

擷取空白資料集,這個資料集的排序及順序語意與這個執行個體相同。Retrieves an empty set that has the same sorting and ordering semantics as this instance.

IImmutableSet<T>.Except(IEnumerable<T>) IImmutableSet<T>.Except(IEnumerable<T>) IImmutableSet<T>.Except(IEnumerable<T>) IImmutableSet<T>.Except(IEnumerable<T>)

從目前的資料集中,移除指定之集合內的項目。Removes the elements in the specified collection from the current set.

IImmutableSet<T>.Intersect(IEnumerable<T>) IImmutableSet<T>.Intersect(IEnumerable<T>) IImmutableSet<T>.Intersect(IEnumerable<T>) IImmutableSet<T>.Intersect(IEnumerable<T>)

建立不可變的資料集,其中包含存在於這個資料集和指定之資料集中的項目。Creates an immutable set that contains elements that exist in both this set and the specified set.

IImmutableSet<T>.Remove(T) IImmutableSet<T>.Remove(T) IImmutableSet<T>.Remove(T) IImmutableSet<T>.Remove(T)

從這個不可變的資料集中移除指定的項目。Removes the specified element from this immutable set.

IImmutableSet<T>.SymmetricExcept(IEnumerable<T>) IImmutableSet<T>.SymmetricExcept(IEnumerable<T>) IImmutableSet<T>.SymmetricExcept(IEnumerable<T>) IImmutableSet<T>.SymmetricExcept(IEnumerable<T>)

建立不可變的資料集,其中僅包含在目前資料集或指定之集合 (但非兩者) 中出現的項目。Creates an immutable set that contains only elements that are present either in the current set or in the specified collection, but not both.

IImmutableSet<T>.Union(IEnumerable<T>) IImmutableSet<T>.Union(IEnumerable<T>) IImmutableSet<T>.Union(IEnumerable<T>) IImmutableSet<T>.Union(IEnumerable<T>)

建立新的不可變資料集,其中包含在目前資料集或指定之集合中出現的所有項目。Creates a new immutable set that contains all elements that are present in either the current set or in the specified collection.

ISet<T>.Add(T) ISet<T>.Add(T) ISet<T>.Add(T) ISet<T>.Add(T)

將項目加入至目前的資料集,並傳回指出是否成功加入項目的值。Adds an element to the current set and returns a value that indicates whether the element was successfully added.

ISet<T>.ExceptWith(IEnumerable<T>) ISet<T>.ExceptWith(IEnumerable<T>) ISet<T>.ExceptWith(IEnumerable<T>) ISet<T>.ExceptWith(IEnumerable<T>)

從目前的資料集中,移除指定之集合內的所有項目。Removes all elements in the specified collection from the current set.

ISet<T>.IntersectWith(IEnumerable<T>) ISet<T>.IntersectWith(IEnumerable<T>) ISet<T>.IntersectWith(IEnumerable<T>) ISet<T>.IntersectWith(IEnumerable<T>)

修改目前的資料集,使其僅包含同時也在指定之集合中出現的項目。Modifies the current set so that it contains only elements that are also in a specified collection.

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

ISet<T>.UnionWith(IEnumerable<T>) ISet<T>.UnionWith(IEnumerable<T>) ISet<T>.UnionWith(IEnumerable<T>) ISet<T>.UnionWith(IEnumerable<T>)

修改目前的資料集,使其包含目前資料集或指定之集合中出現的所有項目。Modifies the current set so that it contains all elements that are present in either the current set or in the specified collection.

擴充方法

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 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)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 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)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 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.

適用於

執行緒安全性

此型別具備執行緒安全。This type is thread safe.