Class Set
Represents various extension methods for sets.
Inherited Members
Namespace: DotNext.Collections.Generic
Assembly: DotNext.dll
Syntax
public static class Set
Methods
| Edit this page View SourceRange<T, TLowerBound, TUpperBound>(TLowerBound, TUpperBound)
Creates a range using the specified bounds.
Declaration
public static IReadOnlySet<T> Range<T, TLowerBound, TUpperBound>(TLowerBound lowerBound, TUpperBound upperBound) where T : IBinaryInteger<T> where TLowerBound : IFiniteRangeEndpoint<T> where TUpperBound : IFiniteRangeEndpoint<T>
Parameters
| Type | Name | Description |
|---|---|---|
| TLowerBound | lowerBound | The lower bound of the range. |
| TUpperBound | upperBound | The upper bound of the range. |
Returns
| Type | Description |
|---|---|
| IReadOnlySet<T> | An ordered set of elements in the range. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the range. |
| TLowerBound | The type of lower bound. |
| TUpperBound | The type of upper bound. |
Singleton<T>(T)
Constructs read-only set with a single item in it.
Declaration
public static IReadOnlySet<T> Singleton<T>(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | An item to be placed into set. |
Returns
| Type | Description |
|---|---|
| IReadOnlySet<T> | Read-only set containing single item. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of set items. |