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 IEnumerable<T>
public class PartitionerEnumerable<T> : IEnumerable<T>, IEnumerableType Parameters
- T
- The type of objects to enumerate. 
- Inheritance
- 
      
      PartitionerEnumerable<T>
- Implements
- 
      IEnumerable<T>
- Derived
Constructors
PartitionerEnumerable(IEnumerable<T>, int)
Initializes a new instance of the PartitionerEnumerable<T> class.
public PartitionerEnumerable(IEnumerable<T> source, int partitionSize = 128)Parameters
- sourceIEnumerable<T>
- The sequence to iterate in partitions. 
- partitionSizeint
- The size of the partitions. 
Exceptions
- ArgumentOutOfRangeException
- partitionSizeis lower than 0.
Properties
HasPartitions
Gets a value indicating whether this instance has partitions remaining to be iterated.
public bool HasPartitions { get; }Property Value
- bool
- trueif 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
- int
- 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
- int
- 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.