Export (0) Print
Expand All

ImmutableSortedSet(T) Class

Represents an immutable sorted set implementation.

NuGet package: Microsoft.Bcl.Immutable (about immutable collections and how to install)

System.Object
  System.Collections.Immutable.ImmutableSortedSet(T)

Namespace:  System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

[<Sealed>]
type ImmutableSortedSet<'T> =  
    class 
        interface IImmutableSet<'T>
        interface IReadOnlyList<'T>
        interface IReadOnlyCollection<'T>
        interface IList<'T>
        interface ISet<'T>
        interface ICollection<'T>
        interface IEnumerable<'T>
        interface IList 
        interface ICollection 
        interface IEnumerable 
    end

Type Parameters

T

The type of elements in the set.

The ImmutableSortedSet(T) type exposes the following members.

  NameDescription
Public propertyCountGets the number of elements in the immutable sorted set.
Public propertyIsEmptyGets a value that indicates whether this immutable sorted set is empty.
Public propertyItemGets the element of the immutable sorted set at the given index.
Public propertyKeyComparerGets the comparer used to sort keys in the immutable sorted set.
Public propertyMaxGets the maximum value in the immutable sorted set, as defined by the comparer.
Public propertyMinGets the minimum value in the immutable sorted set, as defined by the comparer.
Top

  NameDescription
Public methodAddAdds the specified value to this immutable sorted set.
Public methodClearRemoves all elements from the immutable sorted set.
Public methodContainsDetermines whether this immutable sorted set contains the specified value.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodExceptRemoves a specified set of items from this immutable sorted set.
Public methodGetEnumeratorReturns an enumerator that iterates through the immutable sorted set.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfGets the position within this immutable sorted set that the specified value appears in.
Public methodIntersectCreates an immutable sorted set that contains elements that exist both in this set and in the specified set.
Public methodIsProperSubsetOfDetermines whether the current immutable sorted set is a proper (strict) subset of the specified collection.
Public methodIsProperSupersetOfDetermines whether the current immutable sorted set is a proper superset of a specified collection.
Public methodIsSubsetOfDetermines whether the current immutable sorted set is a subset of a specified collection.
Public methodIsSupersetOfDetermines whether the current immutable sorted set is a superset of a specified collection.
Public methodOverlapsDetermines whether the current immutable sorted set and a specified collection share common elements.
Public methodRemoveRemoves the specified value from this immutable sorted set.
Public methodReverseReturns an IEnumerable(T) that iterates over this immutable sorted set in reverse order.
Public methodSetEqualsDetermines whether the current immutable sorted set and the specified collection contain the same elements.
Public methodSymmetricExceptCreates an immutable sorted set that contains elements that exist either in this set or in a given sequence, but not both.
Public methodToBuilderCreates a collection that has the same contents as this immutable sorted set that can be efficiently manipulated by using standard mutable interfaces.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodTryGetValueSearches the set for a given value and returns the equal value it finds, if any.
Public methodUnionAdds a given set of items to this immutable sorted set.
Public methodWithComparerReturns the immutable sorted set that has the specified key comparer.
Top

  NameDescription
Public Extension MethodToImmutableArray(T) [This topic is preliminary and is subject to change.]
Creates an immutable array from the specified collection.
(Defined by ImmutableArray.)
Public Extension MethodToImmutableDictionary(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.)
Public Extension MethodToImmutableDictionary(T, TKey)(Func(T, TKey), IEqualityComparer(TKey))Overloaded. Constructs an immutable dictionary based on some transformation of a sequence. (Defined by ImmutableDictionary.)
Public Extension MethodToImmutableDictionary(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.)
Public Extension MethodToImmutableDictionary(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.)
Public Extension MethodToImmutableDictionary(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.)
Public Extension MethodToImmutableHashSet(T)()Overloaded. Enumerates a sequence and produces an immutable hash set of its contents. (Defined by ImmutableHashSet.)
Public Extension MethodToImmutableHashSet(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.)
Public Extension MethodToImmutableList(T)Enumerates a sequence and produces an immutable list of its contents. (Defined by ImmutableList.)
Public Extension MethodToImmutableSortedDictionary(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.)
Public Extension MethodToImmutableSortedDictionary(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.)
Public Extension MethodToImmutableSortedDictionary(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.)
Public Extension MethodToImmutableSortedSet(T)()Overloaded. Enumerates a sequence and produces an immutable sorted set of its contents. (Defined by ImmutableSortedSet.)
Public Extension MethodToImmutableSortedSet(T)(IComparer(T))Overloaded. Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer. (Defined by ImmutableSortedSet.)
Top

  NameDescription
Public fieldStatic memberEmptyGets an empty immutable sorted set.
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection(T).AddAdds the specified value to the collection.
Explicit interface implemetationPrivate methodISet(T).AddAdds an element to the current set and returns a value to indicate if the element was successfully added.
Explicit interface implemetationPrivate methodIList.AddAdds an item to the set.
Explicit interface implemetationPrivate methodICollection(T).ClearRemoves all the items from the collection.
Explicit interface implemetationPrivate methodIList.ClearRemoves all items from the set.
Explicit interface implemetationPrivate methodIList.ContainsDetermines whether the set contains a specific value.
Explicit interface implemetationPrivate methodICollection(T).CopyToCopies the elements of the collection to an array, starting at a particular array index.
Explicit interface implemetationPrivate methodICollection.CopyToCopies the elements of the set to an array, starting at a particular array index.
Explicit interface implemetationPrivate methodISet(T).ExceptWithRemoves all elements in the specified collection from the current set.
Explicit interface implemetationPrivate methodIEnumerable(T).GetEnumeratorReturns an enumerator that iterates through the collection.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection.
Explicit interface implemetationPrivate methodIList.IndexOfDetermines the index of a specific item in the set.
Explicit interface implemetationPrivate methodIList(T).InsertInserts an item in the set at the specified index..
Explicit interface implemetationPrivate methodIList.InsertInserts an item into the set at the specified index.
Explicit interface implemetationPrivate methodISet(T).IntersectWithModifies the current set so that it contains only elements that are also in a specified collection
Explicit interface implemetationPrivate propertyIList.IsFixedSizeGets a value indicating whether the immutable sorted set has a fixed size.
Explicit interface implemetationPrivate propertyICollection(T).IsReadOnlyGets a value indicating whether the immutable sorted set is read-only.
Explicit interface implemetationPrivate propertyIList.IsReadOnlyGets a value indicating whether the immutable sorted set is read-only.
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedGets a value indicating whether access to the immutable sorted set is synchronized.
Explicit interface implemetationPrivate propertyIList(T).ItemGets or sets the element at the specified index.
Explicit interface implemetationPrivate propertyIList.ItemGets or sets the element at the specified index.
Explicit interface implemetationPrivate methodICollection(T).RemoveRemoves the first occurrence of a specific object from the collection.
Explicit interface implemetationPrivate methodIList.RemoveRemoves the first occurrence of a specific object from the set.
Explicit interface implemetationPrivate methodIList(T).RemoveAtRemoves the item at the specified index.
Explicit interface implemetationPrivate methodIList.RemoveAtRemoves the item at the specified index of the set.
Explicit interface implemetationPrivate methodISet(T).SymmetricExceptWithModifies 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.
Explicit interface implemetationPrivate propertyICollection.SyncRootGets an object that can be used to synchronize access to the immutable sorted set.
Explicit interface implemetationPrivate methodISet(T).UnionWithModifies the current set so that it contains all elements that are present in either the current set or the specified collection.
Explicit interface implemetationPrivate methodIImmutableSet(T).AddAdds the specified element to this immutable set.
Explicit interface implemetationPrivate methodIImmutableSet(T).ClearRetrieves an empty immutable set that has the same sorting and ordering semantics as this instance.
Explicit interface implemetationPrivate methodIImmutableSet(T).ExceptRemoves the elements in the specified collection from the current immutable set.
Explicit interface implemetationPrivate methodIImmutableSet(T).IntersectCreates an immutable set that contains elements that exist in both this set and the specified set.
Explicit interface implemetationPrivate methodIImmutableSet(T).RemoveRemoves the specified element from this immutable set.
Explicit interface implemetationPrivate methodIImmutableSet(T).SymmetricExceptCreates an immutable set that contains only elements that are present either in the current set or in the specified collection, but not both.
Explicit interface implemetationPrivate methodIImmutableSet(T).UnionCreates a new immutable set that contains all elements that are present in either the current set or in the specified collection.
Top

Create a new immutable sorted set that is prepopulated with items by using the CreateRange 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.

Show:
© 2014 Microsoft