ImmutableHashSet<T>.Builder Class

 

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)

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

System.Object
  System.Collections.Immutable.ImmutableHashSet<T>.Builder

[DebuggerDisplayAttribute("Count = {Count}")]
public sealed class Builder : IReadOnlyCollection<T>, IEnumerable<T>, 
	IEnumerable, ISet<T>, ICollection<T>

NameDescription
System_CAPS_pubpropertyCount

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

System_CAPS_pubpropertyKeyComparer

Gets or sets the key comparer.

NameDescription
System_CAPS_pubmethodAdd(T)

Adds the specified item to the immutable hash set.

System_CAPS_pubmethodClear()

Removes all items from the immutable hash set.

System_CAPS_pubmethodContains(T)

Determines whether the immutable hash set contains a specific value.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExceptWith(IEnumerable<T>)

Removes all elements in the specified collection from the current hash set.

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through the immutable hash set.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIntersectWith(IEnumerable<T>)

Modifies the current set so that it contains only elements that are also in a specified collection.

System_CAPS_pubmethodIsProperSubsetOf(IEnumerable<T>)

Determines whether the current set is a proper (strict) subset of a specified collection.

System_CAPS_pubmethodIsProperSupersetOf(IEnumerable<T>)

Determines whether the current set is a proper (strict) superset of a specified collection.

System_CAPS_pubmethodIsSubsetOf(IEnumerable<T>)

Determines whether the current set is a subset of a specified collection.

System_CAPS_pubmethodIsSupersetOf(IEnumerable<T>)

Determines whether the current set is a superset of a specified collection.

System_CAPS_pubmethodOverlaps(IEnumerable<T>)

Determines whether the current set overlaps with the specified collection.

System_CAPS_pubmethodRemove(T)

Removes the first occurrence of a specific object from the immutable hash set.

System_CAPS_pubmethodSetEquals(IEnumerable<T>)

Determines whether the current set and the specified collection contain the same elements.

System_CAPS_pubmethodSymmetricExceptWith(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.

System_CAPS_pubmethodToImmutable()

Creates an immutable hash set based on the contents of this instance.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodUnionWith(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.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection<T>.Add(T)

Adds an item to the hash set.

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

Copies the elements of the hash set to an array, starting at a particular array index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable<T>.GetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection<T>.IsReadOnly

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

NameDescription
System_CAPS_pubmethodToImmutableArray<T>()

Creates an immutable array from the specified collection.(Defined by ImmutableArray.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey>(Func<T, TKey>)

Overloaded. Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey>(Func<T, TKey>, IEqualityComparer<TKey>)

Overloaded. Constructs an immutable dictionary based on some transformation of a sequence.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IEqualityComparer<TKey>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key comparer.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key and value comparers.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableHashSet<T>()

Overloaded. Enumerates a sequence and produces an immutable hash set of its contents.(Defined by ImmutableHashSet.)

System_CAPS_pubmethodToImmutableHashSet<T>(IEqualityComparer<T>)

Overloaded. Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.(Defined by ImmutableHashSet.)

System_CAPS_pubmethodToImmutableList<T>()

Enumerates a sequence and produces an immutable list of its contents.(Defined by ImmutableList.)

System_CAPS_pubmethodToImmutableSortedDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IComparer<TKey>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key comparer.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedSet<T>()

Overloaded. Enumerates a sequence and produces an immutable sorted set of its contents.(Defined by ImmutableSortedSet.)

System_CAPS_pubmethodToImmutableSortedSet<T>(IComparer<T>)

Overloaded. Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer.(Defined by ImmutableSortedSet.)

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.

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: