org.databene.benerator.distribution.sequence
Class ShuffleLongGenerator

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
      extended by org.databene.benerator.primitive.number.AbstractNumberGenerator<java.lang.Long>
          extended by org.databene.benerator.distribution.sequence.ShuffleLongGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.Long>, Resettable, ThreadAware

public class ShuffleLongGenerator
extends AbstractNumberGenerator<java.lang.Long>

Long Generator that implements a 'shuffle' Long Sequence: It starts with min and produced numbers by continuously incrementing the cursor by a fix increment value; when max is reached, it repeats the procedure starting by min+precision, later min+2*precision and so on. The generated numbers are unique as long as the generator is not reset.

Created: 18.06.2006 14:40:29

Since:
0.1
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.primitive.number.AbstractNumberGenerator
generatedType, max, min, precision
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
ShuffleLongGenerator()
           
ShuffleLongGenerator(long min, long max)
           
ShuffleLongGenerator(long min, long max, long precision, long increment)
           
 
Method Summary
 java.lang.Long generate()
          Returns an instance of the generic type E.
 long getIncrement()
           
 void init(GeneratorContext context)
           
 void reset()
           
 void setIncrement(long increment)
           
 
Methods inherited from class org.databene.benerator.primitive.number.AbstractNumberGenerator
getGeneratedType, getMax, getMin, getPrecision, isParallelizable, isThreadSafe, setMax, setMin, setPrecision
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, close, toString, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShuffleLongGenerator

public ShuffleLongGenerator()

ShuffleLongGenerator

public ShuffleLongGenerator(long min,
                            long max)

ShuffleLongGenerator

public ShuffleLongGenerator(long min,
                            long max,
                            long precision,
                            long increment)
Method Detail

getIncrement

public long getIncrement()

setIncrement

public void setIncrement(long increment)

init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<java.lang.Long>
Overrides:
init in class AbstractNumberGenerator<java.lang.Long>

generate

public java.lang.Long generate()
Description copied from interface: Generator
Returns an instance of the generic type E.


reset

public void reset()
Specified by:
reset in interface Resettable
Overrides:
reset in class AbstractGenerator<java.lang.Long>


Copyright © 2010. All Rights Reserved.