org.databene.benerator.wrapper
Class RepeatGeneratorProxy<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.RepeatGeneratorProxy<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, Resettable, ThreadAware

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

A generator proxy that forwards the output of another generator with a random number of repetitions.

Created: 18.08.2007 17:08:10

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.CardinalGenerator
countGenerator
 
Fields inherited from class org.databene.benerator.wrapper.GeneratorWrapper
source
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
RepeatGeneratorProxy()
           
RepeatGeneratorProxy(Generator<E> source, long minRepetitions, long maxRepetitions)
           
RepeatGeneratorProxy(Generator<E> source, long minRepetitions, long maxRepetitions, int repetitionPrecision, Distribution repetitionDistribution)
           
 
Method Summary
 E generate()
          Returns an instance of the generic type E.
 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
setCountDistribution, setCountPrecision, setMaxCount, setMinCount
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
close, equals, getSource, hashCode, isParallelizable, isThreadSafe, setSource, toString
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepeatGeneratorProxy

public RepeatGeneratorProxy()

RepeatGeneratorProxy

public RepeatGeneratorProxy(Generator<E> source,
                            long minRepetitions,
                            long maxRepetitions)

RepeatGeneratorProxy

public RepeatGeneratorProxy(Generator<E> source,
                            long minRepetitions,
                            long maxRepetitions,
                            int repetitionPrecision,
                            Distribution repetitionDistribution)
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 E 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 CardinalGenerator<E,E>


Copyright © 2010. All Rights Reserved.