org.databene.benerator.wrapper
Class CollectionGenerator<C extends java.util.Collection,I>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.GeneratorWrapper<S,P>
org.databene.benerator.wrapper.CardinalGenerator<I,C>
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
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CollectionGenerator
public CollectionGenerator()
CollectionGenerator
public CollectionGenerator(java.lang.Class<C> collectionType,
Generator<I> source,
int minSize,
int maxSize,
Distribution sizeDistribution)
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 ProductWrapper<C> generate(ProductWrapper<C> 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.
Copyright © 2013. All Rights Reserved.