<PackageReference Include="System.Collections" Version="4.0.11-beta-23409" />

SortedSet<T>

Represents a collection of objects that is maintained in sorted order.

Enumerates the elements of a SortedSet<T> object.

public IComparer<T> Comparer { get; }

Gets the IEqualityComparer<T> object that is used to determine equality for the values in the SortedSet<T>.

public int Count { get; }

Gets the number of elements in the SortedSet<T>.

public T Max { get; }

Gets the maximum value in the SortedSet<T>, as defined by the comparer.

public T Min { get; }

Gets the minimum value in the SortedSet<T>, as defined by the comparer.

public SortedSet()

Initializes a new instance of the SortedSet<T> class.

public SortedSet(IComparer<T> comparer)

Initializes a new instance of the SortedSet<T> class that uses a specified comparer.

public SortedSet(IEnumerable<T> collection)

Initializes a new instance of the SortedSet<T> class that contains elements copied from a specified enumerable collection.

public SortedSet(IEnumerable<T> collection, IComparer<T> comparer)

Initializes a new instance of the SortedSet<T> class that contains elements copied from a specified enumerable collection and that uses a specified comparer.

public bool Add(T item)

Adds an element to the set and returns a value that indicates if it was successfully added.

public virtual void Clear()

Removes all elements from the set.

public virtual bool Contains(T item)

Determines whether the set contains a specific element.

public void CopyTo(T[] array)

Copies the complete SortedSet<T> to a compatible one-dimensional array, starting at the beginning of the target array.

public void CopyTo(T[] array, int index)

Copies the complete SortedSet<T> to a compatible one-dimensional array, starting at the specified array index.

public void CopyTo(T[] array, int index, int count)

Copies a specified number of elements from SortedSet<T> to a compatible one-dimensional array, starting at the specified array index.

public void ExceptWith(IEnumerable<T> other)

Removes all elements that are in a specified collection from the current SortedSet<T> object.

Returns an enumerator that iterates through the SortedSet<T>.

public virtual SortedSet<T> GetViewBetween(T lowerValue, T upperValue)

Returns a view of a subset in a SortedSet<T>.

public virtual void IntersectWith(IEnumerable<T> other)

Modifies the current SortedSet<T> object so that it contains only elements that are also in a specified collection.

public bool IsProperSubsetOf(IEnumerable<T> other)

Determines whether a SortedSet<T> object is a proper subset of the specified collection.

public bool IsProperSupersetOf(IEnumerable<T> other)

Determines whether a SortedSet<T> object is a proper superset of the specified collection.

public bool IsSubsetOf(IEnumerable<T> other)

Determines whether a SortedSet<T> object is a subset of the specified collection.

public bool IsSupersetOf(IEnumerable<T> other)

Determines whether a SortedSet<T> object is a superset of the specified collection.

public bool Overlaps(IEnumerable<T> other)

Determines whether the current SortedSet<T> object and a specified collection share common elements.

public bool Remove(T item)

Removes a specified item from the SortedSet<T>.

public int RemoveWhere(Predicate<T> match)

Removes all elements that match the conditions defined by the specified predicate from a SortedSet<T>.

public IEnumerable<T> Reverse()

Returns an IEnumerable<T> that iterates over the SortedSet<T> in reverse order.

public bool SetEquals(IEnumerable<T> other)

Determines whether the current SortedSet<T> object and the specified collection contain the same elements.

public void SymmetricExceptWith(IEnumerable<T> other)

Modifies the current SortedSet<T> object so that it contains only elements that are present either in the current object or in the specified collection, but not both.

public void UnionWith(IEnumerable<T> other)

Modifies the current SortedSet<T> object so that it contains all elements that are present in either the current object or the specified collection.