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
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
sbyteNext value to generate.
step
sbyteDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentOutOfRangeException
When
bounds
do not containstart
.- 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
sbyteNext value to generate.
step
sbyteDifference 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
sbytePreviously generated value.
Returns
- sbyte
Next value to generate.
Exceptions
- OverflowException
When an arithmetic overflow occurred.