Class Set
Represents various extension methods for sets.
Inherited Members
Namespace: DotNext.Collections.Generic
Assembly: DotNext.dll
Syntax
public static class Set
Methods
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 : notnull, IBinaryInteger<T> where TLowerBound : notnull, IFiniteRangeEndpoint<T>, allows ref struct where TUpperBound : notnull, IFiniteRangeEndpoint<T>, allows ref struct
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 | |
| 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 |
get_Empty<T>()
Gets the empty set.
Declaration
public static IReadOnlySet<T> get_Empty<T>()
Returns
| Type | Description |
|---|---|
| IReadOnlySet<T> |
Type Parameters
| Name | Description |
|---|---|
| T |