Table of Contents

Class PartitionerEnumerable<T>

Namespace
Cuemon.Collections.Generic
Assembly
Cuemon.Core.dll

Exposes the enumerator, which supports iteration in partitions over a collection of a specified type. Implements the System.Collections.Generic.IEnumerable<T>

public class PartitionerEnumerable<T> : IEnumerable<T>, IEnumerable

Type Parameters

T

The type of objects to enumerate.

Inheritance
Object
PartitionerEnumerable<T>
Implements
IEnumerable<T>
IEnumerable
Derived

Constructors

PartitionerEnumerable(IEnumerable<T>, Int32)

Initializes a new instance of the PartitionerEnumerable<T> class.

public PartitionerEnumerable(IEnumerable<T> source, int partitionSize = 128)

Parameters

source IEnumerable<T>

The sequence to iterate in partitions.

partitionSize Int32

The size of the partitions.

Exceptions

ArgumentOutOfRangeException

partitionSize is lower than 0.

Properties

HasPartitions

Gets a value indicating whether this instance has partitions remaining to be iterated.

public bool HasPartitions { get; }

Property Value

Boolean

true if this instance has partitions remaining to be iterated; otherwise, false.

IteratedCount

Gets the number of times the this instance was iterated.

public int IteratedCount { get; }

Property Value

Int32

The number of times the this instance was iterated.

Origin

Gets the sequence that this instance was constructed with.

protected IEnumerable<T> Origin { get; }

Property Value

IEnumerable<T>

The sequence that this instance was constructed with.

PartitionSize

Gets the number of elements per partition.

public int PartitionSize { get; }

Property Value

Int32

The number of elements per partition.

Methods

GetEnumerator()

Returns an enumerator that iterates through the partition of the collection.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the partition of the collection.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

See Also

IEnumerable<T>