Class StepSequence
- java.lang.Object
-
- com.rapiddweller.benerator.distribution.Sequence
-
- com.rapiddweller.benerator.distribution.sequence.StepSequence
-
- All Implemented Interfaces:
Distribution
public class StepSequence extends Sequence
Creates numbers by continuously incrementing a base value by a constant amount.
Created at 30.06.2009 09:55:20- Since:
- 0.6.0
- Author:
- Volker Bergmann
-
-
Constructor Summary
Constructors Constructor Description StepSequence()
Instantiates a new Step sequence.StepSequence(java.math.BigDecimal delta)
Instantiates a new Step sequence.StepSequence(java.math.BigDecimal delta, java.math.BigDecimal initial)
Instantiates a new Step sequence.StepSequence(java.math.BigDecimal delta, java.math.BigDecimal initial, java.math.BigDecimal limit)
Instantiates a new Step sequence.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Generator<T>
applyTo(Generator<T> source, boolean unique)
Apply to generator.<T extends java.lang.Number>
NonNullGenerator<T>createNumberGenerator(java.lang.Class<T> numberType, T min, T max, T granularity, boolean unique)
Create number generator non null generator.java.math.BigDecimal
getDelta()
Gets delta.java.math.BigDecimal
getInitial()
Gets initial.void
setDelta(java.math.BigDecimal delta)
Sets delta.java.lang.String
toString()
-
-
-
Constructor Detail
-
StepSequence
public StepSequence()
Instantiates a new Step sequence.
-
StepSequence
public StepSequence(java.math.BigDecimal delta)
Instantiates a new Step sequence.- Parameters:
delta
- the increment to choose for created generators. When using null, the granularity parameter will be used to set the increment increateNumberGenerator(Class, Number, Number, Number, boolean)
-
StepSequence
public StepSequence(java.math.BigDecimal delta, java.math.BigDecimal initial)
Instantiates a new Step sequence.- Parameters:
delta
- the deltainitial
- the initial
-
StepSequence
public StepSequence(java.math.BigDecimal delta, java.math.BigDecimal initial, java.math.BigDecimal limit)
Instantiates a new Step sequence.- Parameters:
delta
- the deltainitial
- the initiallimit
- the limit
-
-
Method Detail
-
setDelta
public void setDelta(java.math.BigDecimal delta)
Sets delta.- Parameters:
delta
- the delta
-
getDelta
public java.math.BigDecimal getDelta()
Gets delta.- Returns:
- the delta
-
getInitial
public java.math.BigDecimal getInitial()
Gets initial.- Returns:
- the initial
-
applyTo
public <T> Generator<T> applyTo(Generator<T> source, boolean unique)
Description copied from interface:Distribution
Apply to generator.- Specified by:
applyTo
in interfaceDistribution
- Overrides:
applyTo
in classSequence
- Type Parameters:
T
- the type parameter- Parameters:
source
- the sourceunique
- the unique- Returns:
- the generator
-
createNumberGenerator
public <T extends java.lang.Number> NonNullGenerator<T> createNumberGenerator(java.lang.Class<T> numberType, T min, T max, T granularity, boolean unique)
Description copied from interface:Distribution
Create number generator non null generator.- Type Parameters:
T
- the type parameter- Parameters:
numberType
- the number typemin
- the minmax
- the maxgranularity
- the granularityunique
- the unique- Returns:
- the non null generator
-
-