ImmutableList<T>.Builder.Sort 方法

定义

重载

Sort()

使用默认比较器对整个不可变列表中的元素进行排序。Sorts the elements in the entire immutable list by using the default comparer.

Sort(IComparer<T>)

使用指定的比较器对整个不可变列表中的元素进行排序。Sorts the elements in the entire immutable list by using the specified comparer.

Sort(Comparison<T>)

使用指定的比较对象对整个不可变列表中的元素进行排序。Sorts the elements in the entire immutable list by using the specified comparison object.

Sort(Int32, Int32, IComparer<T>)

使用指定的比较器对不可变列表中某个范围内的元素进行排序。Sorts the elements in a range of elements in the immutable list by using the specified comparer.

Sort()

使用默认比较器对整个不可变列表中的元素进行排序。Sorts the elements in the entire immutable list by using the default comparer.

public:
 void Sort();
public void Sort ();
member this.Sort : unit -> unit
Public Sub Sort ()

适用于

Sort(IComparer<T>)

使用指定的比较器对整个不可变列表中的元素进行排序。Sorts the elements in the entire immutable list by using the specified comparer.

public:
 void Sort(System::Collections::Generic::IComparer<T> ^ comparer);
public void Sort (System.Collections.Generic.IComparer<T> comparer);
public void Sort (System.Collections.Generic.IComparer<T>? comparer);
member this.Sort : System.Collections.Generic.IComparer<'T> -> unit
Public Sub Sort (comparer As IComparer(Of T))

参数

comparer
IComparer<T>

比较元素时要使用的实现,若要使用默认比较器 (Default),则为 nullThe implementation to use when comparing elements, or null to use the default comparer (Default).

适用于

Sort(Comparison<T>)

使用指定的比较对象对整个不可变列表中的元素进行排序。Sorts the elements in the entire immutable list by using the specified comparison object.

public:
 void Sort(Comparison<T> ^ comparison);
public void Sort (Comparison<T> comparison);
member this.Sort : Comparison<'T> -> unit
Public Sub Sort (comparison As Comparison(Of T))

参数

comparison
Comparison<T>

比较元素时要使用的对象。The object to use when comparing elements.

例外

comparisonnullcomparison is null.

适用于

Sort(Int32, Int32, IComparer<T>)

使用指定的比较器对不可变列表中某个范围内的元素进行排序。Sorts the elements in a range of elements in the immutable list by using the specified comparer.

public:
 void Sort(int index, int count, System::Collections::Generic::IComparer<T> ^ comparer);
public void Sort (int index, int count, System.Collections.Generic.IComparer<T> comparer);
public void Sort (int index, int count, System.Collections.Generic.IComparer<T>? comparer);
member this.Sort : int * int * System.Collections.Generic.IComparer<'T> -> unit
Public Sub Sort (index As Integer, count As Integer, comparer As IComparer(Of T))

参数

index
Int32

要排序范围的从零开始的起始索引。The zero-based starting index of the range to sort.

count
Int32

要排序的范围的长度。The length of the range to sort.

comparer
IComparer<T>

比较元素时要使用的实现,若要使用默认比较器 (Default),则为 nullThe implementation to use when comparing elements, or null to use the default comparer (Default).

适用于