ImmutableSortedSet(T) Class

ImmutableSortedSet<T> Class

 

Represents an immutable sorted set implementation.

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>

[DebuggerDisplayAttribute("Count = {Count}")]
[DefaultMemberAttribute("Item")]
public sealed class ImmutableSortedSet<T> : IImmutableSet<T>, 
	IReadOnlyList<T>, IReadOnlyCollection<T>, IList<T>, ISet<T>, 
	ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable

Type Parameters

T

The type of elements in the set.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of elements in the immutable sorted set.

System_CAPS_pubpropertyIsEmpty

Gets a value that indicates whether this immutable sorted set is empty.

System_CAPS_pubpropertyItem[Int32]

Gets the element of the immutable sorted set at the given index.

System_CAPS_pubpropertyKeyComparer

Gets the comparer used to sort keys 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 the specified value to this immutable sorted set.

System_CAPS_pubmethodClear()

Removes all elements from the immutable sorted set.

System_CAPS_pubmethodContains(T)

Determines whether this immutable sorted set contains the specified value.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExcept(IEnumerable<T>)

Removes a specified set of items from this immutable sorted set.

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through the immutable sorted set.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIndexOf(T)

Gets the position within this immutable sorted set that the specified value appears in.

System_CAPS_pubmethodIntersect(IEnumerable<T>)

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

System_CAPS_pubmethodIsProperSubsetOf(IEnumerable<T>)

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

System_CAPS_pubmethodIsProperSupersetOf(IEnumerable<T>)

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

System_CAPS_pubmethodIsSubsetOf(IEnumerable<T>)

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

System_CAPS_pubmethodIsSupersetOf(IEnumerable<T>)

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

System_CAPS_pubmethodOverlaps(IEnumerable<T>)

Determines whether the current immutable sorted set and a specified collection share common elements.

System_CAPS_pubmethodRemove(T)

Removes the specified value from this immutable sorted set.

System_CAPS_pubmethodReverse()

Returns an IEnumerable<T> that iterates over this immutable sorted set in reverse order.

System_CAPS_pubmethodSetEquals(IEnumerable<T>)

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

System_CAPS_pubmethodSymmetricExcept(IEnumerable<T>)

Creates an immutable sorted set that contains elements that exist either in this set or in a given sequence, but not both.

System_CAPS_pubmethodToBuilder()

Creates a collection that has the same contents as this immutable sorted set that can be efficiently manipulated by using standard mutable interfaces.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodTryGetValue(T, T)

Searches the set for a given value and returns the equal value it finds, if any.

System_CAPS_pubmethodUnion(IEnumerable<T>)

Adds a given set of items to this immutable sorted set.

System_CAPS_pubmethodWithComparer(IComparer<T>)

Returns the immutable sorted set that has the specified key comparer.

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticEmpty

Gets an empty immutable sorted set.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection<T>.Add(T)

Adds the specified value to the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection<T>.Clear()

Removes all the items from the collection.

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_privmethodICollection<T>.Remove(T)

Removes the first occurrence of a specific object from the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable<T>.GetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList<T>.Insert(Int32, T)

Inserts an item in the set at the specified index..

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList<T>.RemoveAt(Int32)

Removes the item at the specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodISet<T>.Add(T)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodISet<T>.ExceptWith(IEnumerable<T>)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodISet<T>.IntersectWith(IEnumerable<T>)

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

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodISet<T>.UnionWith(IEnumerable<T>)

Modifies the current set so that it contains all elements that are present in either the current set or the specified 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 a collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

Adds an item to the set.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Clear()

Removes all items from the set.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

Determines whether the set contains a specific value.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

Determines the index of a specific item in the set.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

Inserts an item into the set at the specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.RemoveAt(Int32)

Removes the item at the specified index of the set.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIImmutableSet<T>.Add(T)

Adds the specified element to this immutable set.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIImmutableSet<T>.Clear()

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIImmutableSet<T>.Except(IEnumerable<T>)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIImmutableSet<T>.Intersect(IEnumerable<T>)

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

System_CAPS_pubinterfaceSystem_CAPS_privmethodIImmutableSet<T>.Remove(T)

Removes the specified element from this immutable set.

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

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

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

Create a new immutable sorted set that is prepopulated with items by using the CreateRange<T> method. When you manipulate an immutable set with methods such as Add, Reverse or Remove, a copy of the original sorted set is made, manipulations applied and a new immutable sorted set is returned.

If you need to perform multiple operations on an immutable collection, to increase efficiency you can copy the ImmutableSortedSet<T> to a ImmutableSortedSet<T>.Builder, using the ToBuildermethod, manipulate the set and make it immutable again using the ToImmutable method. This will not change the original immutable sorted set.

This type is thread safe.

Return to top
Show:
© 2016 Microsoft