org.databene.benerator.wrapper
Class CollectionGenerator<C extends java.util.Collection,I>

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<I,C>
              extended by org.databene.benerator.wrapper.CollectionGenerator<C,I>
All Implemented Interfaces:
java.io.Closeable, Generator<C>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class CollectionGenerator<C extends java.util.Collection,I>
extends CardinalGenerator<I,C>

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

Created: 07.07.2006 19:13:22

Since:
0.1
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
CollectionGenerator()
           
CollectionGenerator(java.lang.Class<C> collectionType, Generator<I> source, int minSize, int maxSize, Distribution sizeDistribution)
           
 
Method Summary
 C generate()
          Returns an instance of the generic type E.
 java.lang.Class<C> getCollectionType()
           
 java.lang.Class<C> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 void init(GeneratorContext context)
          ensures consistency of the state
 void setCollectionType(java.lang.Class<C> collectionType)
           
 
Methods inherited from class org.databene.benerator.wrapper.CardinalGenerator
reset, 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

CollectionGenerator

public CollectionGenerator()

CollectionGenerator

public CollectionGenerator(java.lang.Class<C> collectionType,
                           Generator<I> source,
                           int minSize,
                           int maxSize,
                           Distribution sizeDistribution)
Method Detail

getCollectionType

public java.lang.Class<C> getCollectionType()

setCollectionType

public void setCollectionType(java.lang.Class<C> collectionType)

init

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

Specified by:
init in interface Generator<C extends java.util.Collection>
Overrides:
init in class CardinalGenerator<I,C extends java.util.Collection>

getGeneratedType

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


generate

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

See Also:
Generator.generate()


Copyright © 2011. All Rights Reserved.