ImmutableSortedSet.Create 方法

定義

多載

Create<T>()

建立空的不可變排序資料集。

Create<T>(IComparer<T>)

建立空的不可變排序資料集,該資料集會使用指定的比較子。

Create<T>(ReadOnlySpan<T>)

建立新的不可變排序資料集,其中包含指定的項目陣列。

Create<T>(T)

建立新的不可變排序資料集,其中包含指定的項目。

Create<T>(T[])

建立新的不可變排序資料集,其中包含指定的項目陣列。

Create<T>(IComparer<T>, ReadOnlySpan<T>)

建立預先填入指定專案的新不可變集合。

Create<T>(IComparer<T>, T)

建立新的不可變排序資料集,其中包含指定的項目且使用指定的比較子。

Create<T>(IComparer<T>, T[])

建立新的不可變排序資料集,其中包含指定的項目陣列且使用指定的比較子。

Create<T>()

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立空的不可變排序資料集。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> ();

類型參數

T

要儲存於不可變資料集中的項目類型。

傳回

空的不可變的已排序資料集。

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
UWP 10.0

Create<T>(IComparer<T>)

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立空的不可變排序資料集,該資料集會使用指定的比較子。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T> comparer);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T>? comparer);

類型參數

T

不可變資料集中的項目類型。

參數

comparer
IComparer<T>

比較資料集中的項目時所使用的實作。

傳回

空的不可變資料集。

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
UWP 10.0

Create<T>(ReadOnlySpan<T>)

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立新的不可變排序資料集,其中包含指定的項目陣列。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (ReadOnlySpan<T> items);

類型參數

T

不可變資料集中的項目類型。

參數

items
ReadOnlySpan<T>

範圍,包含要預先填入集合的專案。

傳回

新的不可變資料集,其中包含指定的項目。

適用於

.NET 9 和 .NET 8
產品 版本
.NET 8, 9

Create<T>(T)

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立新的不可變排序資料集,其中包含指定的項目。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (T item);

類型參數

T

不可變資料集中的項目類型。

參數

item
T

要預先填入資料集的項目。

傳回

建立新的不可變資料集,其中包含指定的項目。

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
UWP 10.0

Create<T>(T[])

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立新的不可變排序資料集,其中包含指定的項目陣列。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (params T[] items);

類型參數

T

不可變資料集中的項目類型。

參數

items
T[]

陣列,其中包含要預先填入資料集的項目。

傳回

新的不可變資料集,其中包含指定的項目。

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
UWP 10.0

Create<T>(IComparer<T>, ReadOnlySpan<T>)

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立預先填入指定專案的新不可變集合。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T>? comparer, ReadOnlySpan<T> items);

類型參數

T

由集合所儲存的項目類型。

參數

comparer
IComparer<T>

比較子。

items
ReadOnlySpan<T>

要預先填入的專案。

傳回

新的不可變集合。

適用於

.NET 9 和 .NET 8
產品 版本
.NET 8, 9

Create<T>(IComparer<T>, T)

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立新的不可變排序資料集,其中包含指定的項目且使用指定的比較子。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T> comparer, T item);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T>? comparer, T item);

類型參數

T

儲存於不可變資料集中的項目類型。

參數

comparer
IComparer<T>

比較資料集中的項目時所使用的實作。

item
T

要預先填入資料集的項目。

傳回

建立新的不可變資料集,其中包含指定的項目。

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
UWP 10.0

Create<T>(IComparer<T>, T[])

來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs
來源:
ImmutableSortedSet.cs

建立新的不可變排序資料集,其中包含指定的項目陣列且使用指定的比較子。

C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T> comparer, params T[] items);
C#
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T> (System.Collections.Generic.IComparer<T>? comparer, params T[] items);

類型參數

T

不可變資料集中的項目類型。

參數

comparer
IComparer<T>

比較資料集中的項目時所使用的實作。

items
T[]

陣列,其中包含要預先填入資料集的項目。

傳回

新的不可變資料集,其中包含指定的項目。

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
UWP 10.0