org.databene.benerator.wrapper
Class SkipGeneratorProxy<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.GeneratorWrapper<S,P>
          extended by org.databene.benerator.wrapper.CardinalGenerator<E,E>
              extended by org.databene.benerator.wrapper.SkipGeneratorProxy<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class SkipGeneratorProxy<E>
extends CardinalGenerator<E,E>

This forwards a source generator's products. Iterates through the products of another generator with a variable step width. This is intended mainly for use with importing generators that provide data volumes too big to keep in RAM.

Created: 26.08.2006 16:16:04

Since:
0.1
Author:
Volker Bergmann

Field Summary
static int DEFAULT_MAX_INCREMENT
           
static int DEFAULT_MIN_INCREMENT
           
 
Fields inherited from class org.databene.benerator.wrapper.CardinalGenerator
cardinalGenerator
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
SkipGeneratorProxy()
           
SkipGeneratorProxy(Generator<E> source)
          Initializes the generator to iterate with increment 1
SkipGeneratorProxy(Generator<E> source, java.lang.Integer minIncrement, java.lang.Integer maxIncrement)
          Initializes the generator to use a random increment of uniform distribution
SkipGeneratorProxy(Generator<E> source, int minIncrement, int maxIncrement, Distribution incrementDistribution, java.lang.Integer limit)
          Initializes the generator to use a random increment of uniform distribution
SkipGeneratorProxy(java.lang.Integer minIncrement, java.lang.Integer maxIncrement)
           
 
Method Summary
 ProductWrapper<E> generate(ProductWrapper<E> wrapper)
          Returns an instance of the generic type E, using the ProductWrapper instance provided as argument.
 java.lang.Class<E> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 void init(GeneratorContext context)
          ensures consistency of the state
 void reset()
           
 
Methods inherited from class org.databene.benerator.wrapper.CardinalGenerator
generateCardinal, generateCardinalWrapper
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
close, equals, generateFromSource, getSource, getSourceWrapper, hashCode, isParallelizable, isThreadSafe, setSource, toString
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MIN_INCREMENT

public static final int DEFAULT_MIN_INCREMENT
See Also:
Constant Field Values

DEFAULT_MAX_INCREMENT

public static final int DEFAULT_MAX_INCREMENT
See Also:
Constant Field Values
Constructor Detail

SkipGeneratorProxy

public SkipGeneratorProxy()

SkipGeneratorProxy

public SkipGeneratorProxy(Generator<E> source)
Initializes the generator to iterate with increment 1


SkipGeneratorProxy

public SkipGeneratorProxy(java.lang.Integer minIncrement,
                          java.lang.Integer maxIncrement)

SkipGeneratorProxy

public SkipGeneratorProxy(Generator<E> source,
                          java.lang.Integer minIncrement,
                          java.lang.Integer maxIncrement)
Initializes the generator to use a random increment of uniform distribution


SkipGeneratorProxy

public SkipGeneratorProxy(Generator<E> source,
                          int minIncrement,
                          int maxIncrement,
                          Distribution incrementDistribution,
                          java.lang.Integer limit)
Initializes the generator to use a random increment of uniform distribution

Method Detail

getGeneratedType

public java.lang.Class<E> getGeneratedType()
Description copied from interface: Generator
Declares the type of the objects returned by the generate() method.


init

public void init(GeneratorContext context)
Description copied from class: CardinalGenerator
ensures consistency of the state

Specified by:
init in interface Generator<E>
Overrides:
init in class CardinalGenerator<E,E>

generate

public ProductWrapper<E> generate(ProductWrapper<E> wrapper)
Description copied from interface: Generator
Returns an instance of the generic type E, using the ProductWrapper instance provided as argument. The wrapper may wrap a null value as a regular generator product. If the generator is not available (any more), it returns null instead of the ProductWrapper instance.


reset

public void reset()
Specified by:
reset in interface org.databene.commons.Resettable
Overrides:
reset in class CardinalGenerator<E,E>


Copyright © 2013. All Rights Reserved.