Table of Contents

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

bounds Bounds<uint>

Range of values that can be generated.

UintSequenceGenerator(Bounds<uint>, uint, uint)

Creates a new UintSequenceGenerator instance.

public UintSequenceGenerator(Bounds<uint> bounds, uint start, uint step = 1)

Parameters

bounds Bounds<uint>

Range of values that can be generated.

start uint

Next value to generate.

step uint

Difference between two consecutively generated values. Equal to 1 by default.

Exceptions

ArgumentOutOfRangeException

When bounds do not contain start.

ArgumentException

When step is equal to 0.

UintSequenceGenerator(uint, uint)

Creates a new UintSequenceGenerator instance with greatest possible Bounds.

public UintSequenceGenerator(uint start, uint step = 1)

Parameters

start uint

Next value to generate.

step uint

Difference between two consecutively generated values. Equal to 1 by default.

Exceptions

ArgumentException

When step is 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

value uint

Previously generated value.

Returns

uint

Next value to generate.

Exceptions

OverflowException

When an arithmetic overflow occurred.