Table of Contents

Class ByteSequenceGenerator

Namespace
LfrlAnvil.Generators
Assembly
LfrlAnvil.Core.dll

Represents byte sequence generator of values within specified range.

public class ByteSequenceGenerator : SequenceGeneratorBase<byte>, ISequenceGenerator<byte>, IBoundGenerator<byte>, IGenerator<byte>, IGenerator
Inheritance
ByteSequenceGenerator
Implements
Inherited Members
Extension Methods

Constructors

ByteSequenceGenerator()

Creates a new ByteSequenceGenerator instance that starts with 0, with Step equal to 1 and with greatest possible Bounds.

public ByteSequenceGenerator()

ByteSequenceGenerator(Bounds<byte>)

Creates a new ByteSequenceGenerator instance that starts with minimum possible value defined by bounds, with Step equal to 1.

public ByteSequenceGenerator(Bounds<byte> bounds)

Parameters

bounds Bounds<byte>

Range of values that can be generated.

ByteSequenceGenerator(Bounds<byte>, byte, byte)

Creates a new ByteSequenceGenerator instance.

public ByteSequenceGenerator(Bounds<byte> bounds, byte start, byte step = 1)

Parameters

bounds Bounds<byte>

Range of values that can be generated.

start byte

Next value to generate.

step byte

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.

ByteSequenceGenerator(byte, byte)

Creates a new ByteSequenceGenerator instance with greatest possible Bounds.

public ByteSequenceGenerator(byte start, byte step = 1)

Parameters

start byte

Next value to generate.

step byte

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

Exceptions

ArgumentException

When step is equal to 0.

Methods

AddStep(byte)

Adds Step to the previously generated value in order to calculate the next value to generate.

protected override sealed byte AddStep(byte value)

Parameters

value byte

Previously generated value.

Returns

byte

Next value to generate.

Exceptions

OverflowException

When an arithmetic overflow occurred.