IImmutableSet<T> IImmutableSet<T> IImmutableSet<T> IImmutableSet<T> Interface

Definition

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)

generic <typename T>
public interface class IImmutableSet : System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IReadOnlyCollection<T>
public interface IImmutableSet<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>
type IImmutableSet<'T> = interface
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyCollection<'T>
Public Interface IImmutableSet(Of T)
Implements IEnumerable(Of T), IReadOnlyCollection(Of T)

Type Parameters

T

The type of element stored in the set.

Derived
Implements

Remarks

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.

Methods

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

Adds the specified element to this immutable set.

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

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

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

Determines whether this immutable set contains a specified element.

Except(IEnumerable<T>) Except(IEnumerable<T>) Except(IEnumerable<T>) Except(IEnumerable<T>)

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

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

Returns an enumerator that iterates through a collection.

(Inherited from IEnumerable)
Intersect(IEnumerable<T>) Intersect(IEnumerable<T>) Intersect(IEnumerable<T>) Intersect(IEnumerable<T>)

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

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

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

IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>)

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

IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>)

Determines whether the current immutable 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 set is a superset of a specified collection.

Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>)

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

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

Removes the specified element from this immutable set.

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

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

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

TryGetValue(T, T) TryGetValue(T, T) TryGetValue(T, T) TryGetValue(T, T)

Determines whether the set contains a specified value.

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

Properties

Count Count Count Count

Gets the number of elements in the collection.

(Inherited from IReadOnlyCollection<T>)

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