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>, Resettable, ThreadAware
Direct Known Subclasses:
CollectionGenerator, InstanceArrayGenerator, RepeatGeneratorProxy

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  Generator<java.lang.Long> countGenerator
          Generator that determines the cardinality of generation
 
Fields inherited from class org.databene.benerator.wrapper.GeneratorWrapper
source
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
CardinalGenerator()
           
CardinalGenerator(Generator<S> source)
           
CardinalGenerator(Generator<S> source, long minCount, long maxCount, long countPrecision, Distribution countDistribution)
           
 
Method Summary
 void init(GeneratorContext context)
          ensures consistency of the state
 void reset()
           
 void setCountDistribution(Distribution distribution)
           
 void setCountPrecision(long countPrecision)
           
 void setMaxCount(long maxCount)
           
 void setMinCount(long minCount)
           
 
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
 
Methods inherited from interface org.databene.benerator.Generator
generate, getGeneratedType
 

Field Detail

countGenerator

protected Generator<java.lang.Long> countGenerator
Generator that determines the cardinality of generation

Constructor Detail

CardinalGenerator

public CardinalGenerator()

CardinalGenerator

public CardinalGenerator(Generator<S> source)

CardinalGenerator

public CardinalGenerator(Generator<S> source,
                         long minCount,
                         long maxCount,
                         long countPrecision,
                         Distribution countDistribution)
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>

setMinCount

public void setMinCount(long minCount)

setMaxCount

public void setMaxCount(long maxCount)

setCountPrecision

public void setCountPrecision(long countPrecision)

setCountDistribution

public void setCountDistribution(Distribution distribution)

reset

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


Copyright © 2010. All Rights Reserved.