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
boundsBounds<sbyte>Range of values that can be generated.
startsbyteNext value to generate.
stepsbyteDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentOutOfRangeException
When
boundsdo not containstart.- ArgumentException
When
stepis equal to 0.
SbyteSequenceGenerator(sbyte, sbyte)
Creates a new SbyteSequenceGenerator instance with greatest possible Bounds.
public SbyteSequenceGenerator(sbyte start, sbyte step = 1)
Parameters
startsbyteNext value to generate.
stepsbyteDifference between two consecutively generated values. Equal to 1 by default.
Exceptions
- ArgumentException
When
stepis 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
valuesbytePreviously generated value.
Returns
- sbyte
Next value to generate.
Exceptions
- OverflowException
When an arithmetic overflow occurred.