ImmutableHashSet<T>.Builder ImmutableHashSet<T>.Builder ImmutableHashSet<T>.Builder ImmutableHashSet<T>.Builder Class

Definition

Represents a hash set that mutates with little or no memory allocations and that can produce or build on immutable hash set instances very efficiently.

NuGet package: System.Collections.Immutable (about immutable collections and how to install)

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

Type Parameters

T
Inheritance
ImmutableHashSet<T>.BuilderImmutableHashSet<T>.BuilderImmutableHashSet<T>.BuilderImmutableHashSet<T>.Builder
Implements

Remarks

Although ImmutableHashSet<T>.Union and other methods already provide fast bulk change operations on a collection, the ImmutableHashSet<T>.Builder class allows multiple combinations of changes to be made to a set with equal efficiency.

Properties

Count Count Count Count

Gets the number of elements contained in the immutable hash set.

KeyComparer KeyComparer KeyComparer KeyComparer

Gets or sets the key comparer.

Methods

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

Adds the specified item to the immutable hash set.

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

Removes all items from the immutable hash set.

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

Determines whether the immutable hash set contains a specific value.

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 all elements in the specified collection from the current hash set.

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

Returns an enumerator that iterates through the immutable hash set.

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

Serves as the default hash function.

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

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

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

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 a specific object from the immutable hash set.

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

Explicit Interface Implementations

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

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

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

Gets a value indicating whether the ICollection<T> is read-only.

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

Returns an enumerator that iterates through a collection.

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

Returns an enumerator that iterates through the collection.

Extension Methods

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

Returns 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)

Copies 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)

Copies 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)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(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)

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

Applies to