IImmutableSet<T> Interface

 

Represents a set of elements that can only be modified by creating a new instance of the set.

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)

public interface IImmutableSet<T> : IReadOnlyCollection<T>, IEnumerable<T>, 
	IEnumerable

Type Parameters

T

The type of element stored in the set.

NameDescription
System_CAPS_pubpropertyCount

(Inherited from IReadOnlyCollection<T>.)

NameDescription
System_CAPS_pubmethodAdd(T)

Adds the specified element to this immutable set.

System_CAPS_pubmethodClear()

Retrieves an empty immutable set that has the same sorting and ordering semantics as this instance.

System_CAPS_pubmethodContains(T)

Determines whether this immutable set contains a specified element.

System_CAPS_pubmethodExcept(IEnumerable<T>)

Removes the elements in the specified collection from the current immutable set.

System_CAPS_pubmethodGetEnumerator()

(Inherited from IEnumerable<T>.)

System_CAPS_pubmethodIntersect(IEnumerable<T>)

Creates an immutable set that contains only elements that exist in this set and the specified set.

System_CAPS_pubmethodIsProperSubsetOf(IEnumerable<T>)

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

System_CAPS_pubmethodIsProperSupersetOf(IEnumerable<T>)

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

System_CAPS_pubmethodIsSubsetOf(IEnumerable<T>)

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

System_CAPS_pubmethodIsSupersetOf(IEnumerable<T>)

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

System_CAPS_pubmethodOverlaps(IEnumerable<T>)

Determines whether the current immutable set overlaps with the specified collection.

System_CAPS_pubmethodRemove(T)

Removes the specified element from this immutable set.

System_CAPS_pubmethodSetEquals(IEnumerable<T>)

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

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

System_CAPS_pubmethodTryGetValue(T, T)

Determines whether the set contains a specified value.

System_CAPS_pubmethodUnion(IEnumerable<T>)

Creates a new immutable set that contains all elements that are present in either the current set or in the specified 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.)

Mutations on this set generate new sets. Incremental changes to a set share as much memory as possible with the prior versions of a set, while allowing garbage collection to clean up any unique set data that is no longer being referenced.

Return to top
Show: