Table of Contents

Class SbyteSequenceGenerator

Namespace
LfrlAnvil.Generators
Assembly
LfrlAnvil.Core.dll

Represents sbyte sequence generator of values within specified range.

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

Constructors

SbyteSequenceGenerator()

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

public SbyteSequenceGenerator()

SbyteSequenceGenerator(Bounds<sbyte>)

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

public SbyteSequenceGenerator(Bounds<sbyte> bounds)

Parameters

bounds Bounds<sbyte>

Range of values that can be generated.

SbyteSequenceGenerator(Bounds<sbyte>, sbyte, sbyte)

Creates a new SbyteSequenceGenerator instance.

public SbyteSequenceGenerator(Bounds<sbyte> bounds, sbyte start, sbyte step = 1)

Parameters

bounds Bounds<sbyte>

Range of values that can be generated.

start sbyte

Next value to generate.

step sbyte

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.

SbyteSequenceGenerator(sbyte, sbyte)

Creates a new SbyteSequenceGenerator instance with greatest possible Bounds.

public SbyteSequenceGenerator(sbyte start, sbyte step = 1)

Parameters

start sbyte

Next value to generate.

step sbyte

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

Exceptions

ArgumentException

When step is equal to 0.

Methods

AddStep(sbyte)

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

protected override sealed sbyte AddStep(sbyte value)

Parameters

value sbyte

Previously generated value.

Returns

sbyte

Next value to generate.

Exceptions

OverflowException

When an arithmetic overflow occurred.