org.databene.benerator.composite
Class InstanceArrayGenerator<S>

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,java.lang.Object>
              extended by org.databene.benerator.composite.InstanceArrayGenerator<S>
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.Object>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class InstanceArrayGenerator<S>
extends CardinalGenerator<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, countVariation1 and countVariation2. 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

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
InstanceArrayGenerator(Generator<S> source)
           
 
Method Summary
 java.lang.Object generate()
          Returns an instance of the generic type E.
 java.lang.Class<java.lang.Object> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 
Methods inherited from class org.databene.benerator.wrapper.CardinalGenerator
init, 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

InstanceArrayGenerator

public InstanceArrayGenerator(Generator<S> source)
Method Detail

getGeneratedType

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


generate

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



Copyright © 2011. All Rights Reserved.