Class UintSequenceGenerator
- Namespace
- LfrlAnvil.Generators
- Assembly
- LfrlAnvil.Core.dll
Represents uint sequence generator of values within specified range.
public class UintSequenceGenerator : SequenceGeneratorBase<uint>, ISequenceGenerator<uint>, IBoundGenerator<uint>, IGenerator<uint>, IGenerator
- Inheritance
-
UintSequenceGenerator
- Implements
- Inherited Members
- Extension Methods
Constructors
UintSequenceGenerator()
Creates a new UintSequenceGenerator instance that starts with 0, with Step equal to 1 and with greatest possible Bounds.
public UintSequenceGenerator()
UintSequenceGenerator(Bounds<uint>)
Creates a new UintSequenceGenerator instance that starts with
minimum possible value defined by bounds, with Step equal to 1.
public UintSequenceGenerator(Bounds<uint> bounds)
Parameters
UintSequenceGenerator(Bounds<uint>, uint, uint)
Creates a new UintSequenceGenerator instance.
public UintSequenceGenerator(Bounds<uint> bounds, uint start, uint step = 1)
Parameters
boundsBounds<uint>Range of values that can be generated.
startuintNext value to generate.
stepuintDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentOutOfRangeException
When
boundsdo not containstart.- ArgumentException
When
stepis equal to 0.
UintSequenceGenerator(uint, uint)
Creates a new UintSequenceGenerator instance with greatest possible Bounds.
public UintSequenceGenerator(uint start, uint step = 1)
Parameters
startuintNext value to generate.
stepuintDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentException
When
stepis equal to 0.
Methods
AddStep(uint)
Adds Step to the previously generated value in order to calculate the next value to generate.
protected override sealed uint AddStep(uint value)
Parameters
valueuintPreviously generated value.
Returns
- uint
Next value to generate.
Exceptions
- OverflowException
When an arithmetic overflow occurred.