org.databene.benerator.composite
Class SimplifyingSingleSourceArrayGenerator<S>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.GeneratorWrapper<S,P>
org.databene.benerator.wrapper.CardinalGenerator<S,P>
org.databene.benerator.wrapper.SingleSourceArrayGenerator<S,java.lang.Object>
org.databene.benerator.composite.SimplifyingSingleSourceArrayGenerator<S>
- All Implemented Interfaces:
- java.io.Closeable, Generator<java.lang.Object>, NonNullGenerator<java.lang.Object>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
public class SimplifyingSingleSourceArrayGenerator<S>
- extends SingleSourceArrayGenerator<S,java.lang.Object>
Creates a stochastic number of instances of a type. The number of elements is determined by the values
minCount, maxCount, countDistribution.
If the number of items is not one, an array of respective size is returned,
otherwise a single object.
Created: 06.03.2008 15:43:54
- Since:
- 0.5.0
- Author:
- Volker Bergmann
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.databene.commons.ThreadAware |
isParallelizable, isThreadSafe |
Methods inherited from interface org.databene.commons.Resettable |
reset |
SimplifyingSingleSourceArrayGenerator
public SimplifyingSingleSourceArrayGenerator(Generator<S> source,
NonNullGenerator<java.lang.Integer> countGenerator)
generate
public ProductWrapper<java.lang.Object> generate(ProductWrapper<java.lang.Object> 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.
- Specified by:
generate
in interface Generator<java.lang.Object>
- Overrides:
generate
in class SingleSourceArrayGenerator<S,java.lang.Object>
Copyright © 2013. All Rights Reserved.