Class DynamicLongGenerator
- java.lang.Object
-
- com.rapiddweller.benerator.util.AbstractGenerator<P>
-
- com.rapiddweller.benerator.wrapper.GeneratorWrapper<E,E>
-
- com.rapiddweller.benerator.wrapper.GeneratorProxy<java.lang.Long>
-
- com.rapiddweller.benerator.primitive.DynamicLongGenerator
-
- All Implemented Interfaces:
Generator<java.lang.Long>
,com.rapiddweller.common.Resettable
,com.rapiddweller.common.ThreadAware
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
DynamicCountGenerator
public class DynamicLongGenerator extends GeneratorProxy<java.lang.Long>
Generator
implementation that generatesLong
numbers, redefining the underlying distribution on eachreset()
by evaluating themin
,max
,granularity
,distribution
andunique
values.
Created: 27.03.2010 19:28:38- Since:
- 0.6.0
- Author:
- Volker Bergmann
-
-
Field Summary
Fields Modifier and Type Field Description protected com.rapiddweller.script.Expression<? extends Distribution>
distribution
The Distribution.protected com.rapiddweller.script.Expression<java.lang.Long>
granularity
The Granularity.protected com.rapiddweller.script.Expression<java.lang.Long>
max
The Max.protected com.rapiddweller.script.Expression<java.lang.Long>
min
The Min.-
Fields inherited from class com.rapiddweller.benerator.wrapper.GeneratorProxy
generatedType
-
Fields inherited from class com.rapiddweller.benerator.util.AbstractGenerator
context, logger, state
-
-
Constructor Summary
Constructors Constructor Description DynamicLongGenerator()
Instantiates a new Dynamic long generator.DynamicLongGenerator(com.rapiddweller.script.Expression<java.lang.Long> min, com.rapiddweller.script.Expression<java.lang.Long> max, com.rapiddweller.script.Expression<java.lang.Long> granularity, com.rapiddweller.script.Expression<? extends Distribution> distribution, com.rapiddweller.script.Expression<java.lang.Boolean> unique)
Instantiates a new Dynamic long generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
init(GeneratorContext context)
ensures consistency of the statevoid
reset()
protected void
resetMembers(java.lang.Long minValue, java.lang.Long maxValue)
Reset members.-
Methods inherited from class com.rapiddweller.benerator.wrapper.GeneratorProxy
generate, getGeneratedType, toString
-
Methods inherited from class com.rapiddweller.benerator.wrapper.GeneratorWrapper
close, equals, generateFromSource, getSource, getSourceWrapper, hashCode, isParallelizable, isThreadSafe, setSource
-
Methods inherited from class com.rapiddweller.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
-
-
-
-
Field Detail
-
min
protected final com.rapiddweller.script.Expression<java.lang.Long> min
The Min.
-
max
protected final com.rapiddweller.script.Expression<java.lang.Long> max
The Max.
-
granularity
protected final com.rapiddweller.script.Expression<java.lang.Long> granularity
The Granularity.
-
distribution
protected final com.rapiddweller.script.Expression<? extends Distribution> distribution
The Distribution.
-
-
Constructor Detail
-
DynamicLongGenerator
public DynamicLongGenerator()
Instantiates a new Dynamic long generator.
-
DynamicLongGenerator
public DynamicLongGenerator(com.rapiddweller.script.Expression<java.lang.Long> min, com.rapiddweller.script.Expression<java.lang.Long> max, com.rapiddweller.script.Expression<java.lang.Long> granularity, com.rapiddweller.script.Expression<? extends Distribution> distribution, com.rapiddweller.script.Expression<java.lang.Boolean> unique)
Instantiates a new Dynamic long generator.- Parameters:
min
- the minmax
- the maxgranularity
- the granularitydistribution
- the distributionunique
- the unique
-
-
Method Detail
-
init
public void init(GeneratorContext context)
ensures consistency of the state- Specified by:
init
in interfaceGenerator<java.lang.Long>
- Overrides:
init
in classGeneratorWrapper<java.lang.Long,java.lang.Long>
- Parameters:
context
- the context
-
reset
public void reset()
- Specified by:
reset
in interfacecom.rapiddweller.common.Resettable
- Overrides:
reset
in classGeneratorWrapper<java.lang.Long,java.lang.Long>
-
resetMembers
protected void resetMembers(java.lang.Long minValue, java.lang.Long maxValue)
Reset members.- Parameters:
minValue
- the min valuemaxValue
- the max value
-
-