ImmutableSortedSet<T>.Builder Class

Definition

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)

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

Type Parameters

T
Inheritance
ImmutableSortedSet<T>.Builder
Implements

Remarks

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.

Properties

Count

Gets the number of elements in the immutable sorted set.

Item[Int32]

Gets the element of the set at the given index.

KeyComparer

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

Max

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

Min

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

Methods

Add(T)

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

Clear()

Removes all elements from this set.

Contains(T)

Determines whether the set contains the specified object.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExceptWith(IEnumerable<T>)

Removes the specified set of items from the current set.

GetEnumerator()

Returns an enumerator that iterates through the set.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IntersectWith(IEnumerable<T>)

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

IsProperSubsetOf(IEnumerable<T>)

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

IsProperSupersetOf(IEnumerable<T>)

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

IsSubsetOf(IEnumerable<T>)

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

IsSupersetOf(IEnumerable<T>)

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

ItemRef(Int32)

Gets a read-only reference to the element of the set at the given index.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Overlaps(IEnumerable<T>)

Determines whether the current set overlaps with the specified collection.

Remove(T)

Removes the first occurrence of the specified object from the set.

Reverse()

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

SetEquals(IEnumerable<T>)

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

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

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

ToString()

Returns a string that represents the current object.

(Inherited from Object)
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.CopyTo(Array, Int32)

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

ICollection.IsSynchronized

Gets a value that indicates whether access to the ICollection is synchronized (thread-safe).

ICollection.SyncRoot

Gets an object that can be used to synchronize access to the ICollection.

ICollection<T>.Add(T)

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

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

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

ICollection<T>.IsReadOnly

Gets a value that indicates whether this instance is read-only.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

IEnumerable<T>.GetEnumerator()

Returns an enumerator that iterates through the collection.

Extension Methods

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)

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)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

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)

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

Returns a collection of the descendant nodes of every document and element in the source collection.

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)

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

Returns a collection of the child elements of every element and document in the source collection.

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

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to