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 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.ImmutableSortedSet<T>.Builder

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

NameDescription
System_CAPS_pubpropertyCount

Gets the number of elements in the immutable sorted set.

System_CAPS_pubpropertyKeyComparer

Gets or sets the object that is used to determine equality for the values in the immutable sorted set.

System_CAPS_pubpropertyMax

Gets the maximum value in the immutable sorted set, as defined by the comparer.

System_CAPS_pubpropertyMin

Gets the minimum value in the immutable sorted set, as defined by the comparer.

NameDescription
System_CAPS_pubmethodAdd(T)

Adds an element to the current set and returns a value to indicate whether the element was successfully added.

System_CAPS_pubmethodClear()

Removes all elements from this set.

System_CAPS_pubmethodContains(T)

Determines whether the set contains the specified object.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExceptWith(IEnumerable<T>)

Removes the specified set of items from the current set.

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through the 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 the specified object from the set.

System_CAPS_pubmethodReverse()

Returns an enumerator that iterates over the immutable sorted set in reverse order.

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 sorted 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 element to the current set and returns a value to indicate whether the element was successfully added.

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

Copies the elements of the collection 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_privmethodICollection.CopyTo(Array, Int32)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

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

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: