org.databene.benerator.wrapper
Class UniqueCompositeArrayGenerator<S>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.MultiGeneratorWrapper<S,S[]>
          extended by org.databene.benerator.wrapper.UniqueCompositeArrayGenerator<S>
All Implemented Interfaces:
java.io.Closeable, Generator<S[]>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class UniqueCompositeArrayGenerator<S>
extends MultiGeneratorWrapper<S,S[]>

Creates arrays of unique combinations of the output of other generators. Each array element is filled from an own generator, each used generator is supposed to generate unique values itself.

Created: 17.11.2007 13:37:37

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
availableSources, sources
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
UniqueCompositeArrayGenerator()
           
UniqueCompositeArrayGenerator(java.lang.Class<S> componentType, Generator<? extends S>... sources)
          Initializes the generator to an array of source generators
 
Method Summary
 S[] generate()
          Returns an instance of the generic type E.
 java.lang.Class<S[]> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 void init(GeneratorContext context)
           
 void reset()
           
 
Methods inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
addSource, close, generateFromAllSources, generateFromRandomSource, getSource, getSources, isParallelizable, isThreadSafe, setSources, toString
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniqueCompositeArrayGenerator

public UniqueCompositeArrayGenerator()

UniqueCompositeArrayGenerator

public UniqueCompositeArrayGenerator(java.lang.Class<S> componentType,
                                     Generator<? extends S>... sources)
Initializes the generator to an array of source generators

Method Detail

getGeneratedType

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


init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<S[]>
Overrides:
init in class MultiGeneratorWrapper<S,S[]>

generate

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

See Also:
Generator.generate()

reset

public void reset()
Specified by:
reset in interface org.databene.commons.Resettable
Overrides:
reset in class MultiGeneratorWrapper<S,S[]>


Copyright © 2011. All Rights Reserved.