Partitioner.Create 方法

定义

创建分区程序。

重载

名称 说明
Create(Int32, Int32)

创建一个分区程序,用于对用户指定的范围进行分块。

Create(Int64, Int64)

创建一个分区程序,用于对用户指定的范围进行分块。

Create(Int32, Int32, Int32)

创建一个分区程序,用于对用户指定的范围进行分块。

Create(Int64, Int64, Int64)

创建一个分区程序,用于对用户指定的范围进行分块。

Create<TSource>(IEnumerable<TSource>)

IEnumerable<T> 实例创建可排序的分区程序。

Create<TSource>(IEnumerable<TSource>, EnumerablePartitionerOptions)

IEnumerable<T> 实例创建可排序的分区程序。

Create<TSource>(IList<TSource>, Boolean)

IList<T> 实例创建可排序的分区程序。

Create<TSource>(TSource[], Boolean)

Array 实例创建可排序的分区程序。

Create(Int32, Int32)

创建一个分区程序,用于对用户指定的范围进行分块。

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<int, int> ^> ^ Create(int fromInclusive, int toExclusive);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<int,int>> Create(int fromInclusive, int toExclusive);
static member Create : int * int -> System.Collections.Concurrent.OrderablePartitioner<int * int>
Public Shared Function Create (fromInclusive As Integer, toExclusive As Integer) As OrderablePartitioner(Of Tuple(Of Integer, Integer))

参数

fromInclusive
Int32

范围的下限(非独占边界)。

toExclusive
Int32

范围的上限、独占边界。

返回

分区程序。

例外

参数 toExclusive 小于或等于 fromInclusive 自变量。

注解

有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于

Create(Int64, Int64)

创建一个分区程序,用于对用户指定的范围进行分块。

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<long, long> ^> ^ Create(long fromInclusive, long toExclusive);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<long,long>> Create(long fromInclusive, long toExclusive);
static member Create : int64 * int64 -> System.Collections.Concurrent.OrderablePartitioner<int64 * int64>
Public Shared Function Create (fromInclusive As Long, toExclusive As Long) As OrderablePartitioner(Of Tuple(Of Long, Long))

参数

fromInclusive
Int64

范围的下限(非独占边界)。

toExclusive
Int64

范围的上限、独占边界。

返回

分区程序。

例外

参数 toExclusive 小于或等于 fromInclusive 自变量。

注解

有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于

Create(Int32, Int32, Int32)

创建一个分区程序,用于对用户指定的范围进行分块。

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<int, int> ^> ^ Create(int fromInclusive, int toExclusive, int rangeSize);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<int,int>> Create(int fromInclusive, int toExclusive, int rangeSize);
static member Create : int * int * int -> System.Collections.Concurrent.OrderablePartitioner<int * int>
Public Shared Function Create (fromInclusive As Integer, toExclusive As Integer, rangeSize As Integer) As OrderablePartitioner(Of Tuple(Of Integer, Integer))

参数

fromInclusive
Int32

范围的下限(非独占边界)。

toExclusive
Int32

范围的上限、独占边界。

rangeSize
Int32

每个子范围的大小。

返回

分区程序。

例外

参数 toExclusive 小于或等于 fromInclusive 自变量。

-或-

参数 rangeSize 小于或等于 0。

注解

有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于

Create(Int64, Int64, Int64)

创建一个分区程序,用于对用户指定的范围进行分块。

public:
 static System::Collections::Concurrent::OrderablePartitioner<Tuple<long, long> ^> ^ Create(long fromInclusive, long toExclusive, long rangeSize);
public static System.Collections.Concurrent.OrderablePartitioner<Tuple<long,long>> Create(long fromInclusive, long toExclusive, long rangeSize);
static member Create : int64 * int64 * int64 -> System.Collections.Concurrent.OrderablePartitioner<int64 * int64>
Public Shared Function Create (fromInclusive As Long, toExclusive As Long, rangeSize As Long) As OrderablePartitioner(Of Tuple(Of Long, Long))

参数

fromInclusive
Int64

范围的下限(非独占边界)。

toExclusive
Int64

范围的上限、独占边界。

rangeSize
Int64

每个子范围的大小。

返回

分区程序。

例外

参数 toExclusive 小于或等于 fromInclusive 自变量。

-或-

参数 rangeSize 小于或等于 0。

注解

有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于

Create<TSource>(IEnumerable<TSource>)

IEnumerable<T> 实例创建可排序的分区程序。

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(System::Collections::Generic::IEnumerable<TSource> ^ source);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource>(System.Collections.Generic.IEnumerable<TSource> source);
static member Create : seq<'Source> -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (source As IEnumerable(Of TSource)) As OrderablePartitioner(Of TSource)

类型参数

TSource

源枚举中的元素的类型。

参数

source
IEnumerable<TSource>

要分区的枚举。

返回

基于输入数组的可排序分区程序。

注解

在创建的分区程序中使用的排序由从源可枚举中检索到的元素的自然顺序确定。 有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于

Create<TSource>(IEnumerable<TSource>, EnumerablePartitionerOptions)

IEnumerable<T> 实例创建可排序的分区程序。

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(System::Collections::Generic::IEnumerable<TSource> ^ source, System::Collections::Concurrent::EnumerablePartitionerOptions partitionerOptions);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource>(System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Concurrent.EnumerablePartitionerOptions partitionerOptions);
static member Create : seq<'Source> * System.Collections.Concurrent.EnumerablePartitionerOptions -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (source As IEnumerable(Of TSource), partitionerOptions As EnumerablePartitionerOptions) As OrderablePartitioner(Of TSource)

类型参数

TSource

源枚举中的元素的类型。

参数

source
IEnumerable<TSource>

要分区的枚举。

partitionerOptions
EnumerablePartitionerOptions

用于控制分区程序缓冲行为的选项。

返回

基于输入数组的可排序分区程序。

例外

partitionerOptions 参数指定了无效 EnumerablePartitionerOptions值。

注解

在创建的分区程序中使用的排序由从源可枚举中检索到的元素的自然顺序确定。

适用于

Create<TSource>(IList<TSource>, Boolean)

IList<T> 实例创建可排序的分区程序。

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(System::Collections::Generic::IList<TSource> ^ list, bool loadBalance);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource>(System.Collections.Generic.IList<TSource> list, bool loadBalance);
static member Create : System.Collections.Generic.IList<'Source> * bool -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (list As IList(Of TSource), loadBalance As Boolean) As OrderablePartitioner(Of TSource)

类型参数

TSource

源列表中的元素的类型。

参数

list
IList<TSource>

要分区的列表。

loadBalance
Boolean

一个布尔值,该值指示创建的分区程序是否应在分区之间动态负载均衡,而不是静态分区。

返回

基于输入列表的可排序分区程序。

注解

有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于

Create<TSource>(TSource[], Boolean)

Array 实例创建可排序的分区程序。

public:
generic <typename TSource>
 static System::Collections::Concurrent::OrderablePartitioner<TSource> ^ Create(cli::array <TSource> ^ array, bool loadBalance);
public static System.Collections.Concurrent.OrderablePartitioner<TSource> Create<TSource>(TSource[] array, bool loadBalance);
static member Create : 'Source[] * bool -> System.Collections.Concurrent.OrderablePartitioner<'Source>
Public Shared Function Create(Of TSource) (array As TSource(), loadBalance As Boolean) As OrderablePartitioner(Of TSource)

类型参数

TSource

源数组中元素的类型。

参数

array
TSource[]

要分区的数组。

loadBalance
Boolean

一个布尔值,该值指示创建的分区程序是否应在分区之间动态负载均衡,而不是静态分区。

返回

基于输入数组的可排序分区程序。

注解

有关详细信息和示例,请参阅 PLINQ 和 TPL 的自定义分区程序

另请参阅

适用于