org.databene.benerator.wrapper
Class CardinalGenerator<S,P>

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<S,P>
All Implemented Interfaces:
java.io.Closeable, Generator<P>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
Direct Known Subclasses:
CollectionGenerator, EquivalenceStringGenerator, LengthGenerator, RepeatGeneratorProxy, SingleSourceArrayGenerator, SingleSourceCollectionGenerator, SkipGeneratorProxy

public abstract class CardinalGenerator<S,P>
extends GeneratorWrapper<S,P>

Combines a a random number a source generator's products into a collection.

Created: 06.03.2008 16:08:22

Author:
Volker Bergmann

Field Summary
protected  NonNullGenerator<java.lang.Integer> cardinalGenerator
          Generator that determines the cardinality of generation
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
CardinalGenerator(Generator<S> source, boolean resettingCardinalGenerator)
           
CardinalGenerator(Generator<S> source, boolean resettingCardinalGenerator, int minCardinal, int maxCardinal, int cardinalGranularity, Distribution cardinalDistribution)
           
CardinalGenerator(Generator<S> source, boolean resettingCardinal, NonNullGenerator<java.lang.Integer> cardinalGenerator)
           
 
Method Summary
protected  java.lang.Integer generateCardinal()
           
protected  ProductWrapper<java.lang.Integer> generateCardinalWrapper()
           
 void init(GeneratorContext context)
          ensures consistency of the state
 void reset()
           
 
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
 
Methods inherited from interface org.databene.benerator.Generator
generate, getGeneratedType
 

Field Detail

cardinalGenerator

protected NonNullGenerator<java.lang.Integer> cardinalGenerator
Generator that determines the cardinality of generation

Constructor Detail

CardinalGenerator

public CardinalGenerator(Generator<S> source,
                         boolean resettingCardinal,
                         NonNullGenerator<java.lang.Integer> cardinalGenerator)

CardinalGenerator

public CardinalGenerator(Generator<S> source,
                         boolean resettingCardinalGenerator)

CardinalGenerator

public CardinalGenerator(Generator<S> source,
                         boolean resettingCardinalGenerator,
                         int minCardinal,
                         int maxCardinal,
                         int cardinalGranularity,
                         Distribution cardinalDistribution)
Method Detail

init

public void init(GeneratorContext context)
ensures consistency of the state

Specified by:
init in interface Generator<P>
Overrides:
init in class GeneratorWrapper<S,P>

reset

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

generateCardinal

protected java.lang.Integer generateCardinal()

generateCardinalWrapper

protected ProductWrapper<java.lang.Integer> generateCardinalWrapper()


Copyright © 2013. All Rights Reserved.