ImmutableSortedSet<T> Class
Represents an immutable sorted set implementation.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
generic<typename T> [DefaultMemberAttribute("Item")] [DebuggerDisplayAttribute("Count = {Count}")] public ref class ImmutableSortedSet sealed : IImmutableSet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IReadOnlyList<T>, IList<T>, ICollection<T>, ISet<T>, IList, ICollection
Type Parameters
- T
The type of elements in the set.
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of elements in the immutable sorted set. |
![]() | IsEmpty | Gets a value that indicates whether this immutable sorted set is empty. |
![]() | Item[Int32] | Gets the element of the immutable sorted set at the given index. |
![]() | KeyComparer | Gets the comparer used to sort keys 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. |
| Name | Description | |
|---|---|---|
![]() | Add(T) | Adds the specified value to this immutable sorted set. |
![]() | Clear() | Removes all elements from the immutable sorted set. |
![]() | Contains(T) | Determines whether this immutable sorted set contains the specified value. |
![]() | Equals(Object^) | (Inherited from Object.) |
![]() | Except(IEnumerable<T>^) | Removes a specified set of items from this immutable sorted set. |
![]() | GetEnumerator() | Returns an enumerator that iterates through the immutable sorted set. |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | IndexOf(T) | Gets the position within this immutable sorted set that the specified value appears in. |
![]() | Intersect(IEnumerable<T>^) | Creates an immutable sorted set that contains elements that exist both in this set and in the specified set. |
![]() | IsProperSubsetOf(IEnumerable<T>^) | Determines whether the current immutable sorted set is a proper (strict) subset of the specified collection. |
![]() | IsProperSupersetOf(IEnumerable<T>^) | Determines whether the current immutable sorted set is a proper superset of a specified collection. |
![]() | IsSubsetOf(IEnumerable<T>^) | Determines whether the current immutable sorted set is a subset of a specified collection. |
![]() | IsSupersetOf(IEnumerable<T>^) | Determines whether the current immutable sorted set is a superset of a specified collection. |
![]() | Overlaps(IEnumerable<T>^) | Determines whether the current immutable sorted set and a specified collection share common elements. |
![]() | Remove(T) | Removes the specified value from this immutable sorted set. |
![]() | Reverse() | Returns an IEnumerable<T> that iterates over this immutable sorted set in reverse order. |
![]() | SetEquals(IEnumerable<T>^) | Determines whether the current immutable sorted set and the specified collection contain the same elements. |
![]() | SymmetricExcept(IEnumerable<T>^) | Creates an immutable sorted set that contains elements that exist either in this set or in a given sequence, but not both. |
![]() | ToBuilder() | Creates a collection that has the same contents as this immutable sorted set that can be efficiently manipulated by using standard mutable interfaces. |
![]() | ToString() | (Inherited from Object.) |
![]() | TryGetValue(T, T%) | Searches the set for a given value and returns the equal value it finds, if any. |
![]() | Union(IEnumerable<T>^) | Adds a given set of items to this immutable sorted set. |
![]() | WithComparer(IComparer<T>^) | Returns the immutable sorted set that has the specified key comparer. |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection<T>::Add(T) | Adds the specified value to the collection. |
![]() ![]() | ICollection<T>::Clear() | Removes all the items from the collection. |
![]() ![]() | ICollection<T>::CopyTo(array<T>^, Int32) | Copies the elements of the collection to an array, starting at a particular array index. |
![]() ![]() | ICollection<T>::Remove(T) | Removes the first occurrence of a specific object from the collection. |
![]() ![]() | IEnumerable<T>::GetEnumerator() | Returns an enumerator that iterates through the collection. |
![]() ![]() | IList<T>::Insert(Int32, T) | Inserts an item in the set at the specified index.. |
![]() ![]() | IList<T>::RemoveAt(Int32) | Removes the item at the specified index. |
![]() ![]() | ISet<T>::Add(T) | Adds an element to the current set and returns a value to indicate if the element was successfully added. |
![]() ![]() | ISet<T>::ExceptWith(IEnumerable<T>^) | Removes all elements in the specified collection from the current set. |
![]() ![]() | ISet<T>::IntersectWith(IEnumerable<T>^) | Modifies the current set so that it contains only elements that are also in a specified collection |
![]() ![]() | ISet<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. |
![]() ![]() | ISet<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. |
![]() ![]() | ICollection::CopyTo(Array^, Int32) | Copies the elements of the set to an array, starting at a particular array index. |
![]() ![]() | IEnumerable::GetEnumerator() | Returns an enumerator that iterates through a collection. |
![]() ![]() | IList::Add(Object^) | Adds an item to the set. |
![]() ![]() | IList::Clear() | Removes all items from the set. |
![]() ![]() | IList::Contains(Object^) | Determines whether the set contains a specific value. |
![]() ![]() | IList::IndexOf(Object^) | Determines the index of a specific item in the set. |
![]() ![]() | IList::Insert(Int32, Object^) | Inserts an item into the set at the specified index. |
![]() ![]() | IList::Remove(Object^) | Removes the first occurrence of a specific object from the set. |
![]() ![]() | IList::RemoveAt(Int32) | Removes the item at the specified index of the set. |
![]() ![]() | IImmutableSet<T>::Add(T) | Adds the specified element to this immutable set. |
![]() ![]() | IImmutableSet<T>::Clear() | Retrieves an empty immutable set that has the same sorting and ordering semantics as this instance. |
![]() ![]() | IImmutableSet<T>::Except(IEnumerable<T>^) | Removes the elements in the specified collection from the current immutable set. |
![]() ![]() | IImmutableSet<T>::Intersect(IEnumerable<T>^) | Creates an immutable set that contains elements that exist in both this set and the specified set. |
![]() ![]() | IImmutableSet<T>::Remove(T) | Removes the specified element from this immutable set. |
![]() ![]() | IImmutableSet<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. |
![]() ![]() | IImmutableSet<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. |
![]() ![]() | ICollection<T>::IsReadOnly | See the ICollection<T> interface. |
![]() ![]() | IList<T>::Item[Int32] | See the IList<T> interface. |
![]() ![]() | ICollection::IsSynchronized | See the ICollection interface. |
![]() ![]() | ICollection::SyncRoot | See ICollection. |
![]() ![]() | IList::IsFixedSize | Gets a value indicating whether the IList has a fixed size. |
![]() ![]() | IList::IsReadOnly | Gets a value indicating whether the ICollection<T> is read-only. |
![]() ![]() | IList::Item[Int32] | Gets or sets the Object at the specified index. |
| Name | Description | |
|---|---|---|
![]() | ToImmutableArray<T>() | Creates an immutable array from the specified collection.(Defined by ImmutableArray.) |
![]() | ToImmutableDictionary<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.) |
![]() | ToImmutableDictionary<T, TKey>(Func<T, TKey>^, IEqualityComparer<TKey>^) | Overloaded. Constructs an immutable dictionary based on some transformation of a sequence.(Defined by ImmutableDictionary.) |
![]() | ToImmutableDictionary<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.) |
![]() | ToImmutableDictionary<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.) |
![]() | ToImmutableDictionary<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.) |
![]() | ToImmutableHashSet<T>() | Overloaded. Enumerates a sequence and produces an immutable hash set of its contents.(Defined by ImmutableHashSet.) |
![]() | ToImmutableHashSet<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.) |
![]() | ToImmutableList<T>() | Enumerates a sequence and produces an immutable list of its contents.(Defined by ImmutableList.) |
![]() | ToImmutableSortedDictionary<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.) |
![]() | ToImmutableSortedDictionary<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.) |
![]() | ToImmutableSortedDictionary<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.) |
![]() | ToImmutableSortedSet<T>() | Overloaded. Enumerates a sequence and produces an immutable sorted set of its contents.(Defined by ImmutableSortedSet.) |
![]() | ToImmutableSortedSet<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.






