org.databene.benerator.wrapper
Class UniqueAlternativeGenerator<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.MultiGeneratorWrapper<E,E>
          extended by org.databene.benerator.wrapper.UniqueAlternativeGenerator<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, Resettable, ThreadAware

public class UniqueAlternativeGenerator<E>
extends MultiGeneratorWrapper<E,E>

Forwards the output of other generators in random order, but at most once.

Created: 17.11.2007 17:12:07

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
UniqueAlternativeGenerator()
           
UniqueAlternativeGenerator(java.lang.Class<E> targetType, Generator<E>... sources)
          Initializes the generator to a collection of source generators
 
Method Summary
 E generate()
          Returns an instance of the generic type E.
 java.lang.Class<E> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 
Methods inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
addSource, close, generateFromAllSources, generateFromRandomSource, getSource, getSources, init, isParallelizable, isThreadSafe, reset, 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

UniqueAlternativeGenerator

public UniqueAlternativeGenerator()

UniqueAlternativeGenerator

public UniqueAlternativeGenerator(java.lang.Class<E> targetType,
                                  Generator<E>... sources)
Initializes the generator to a collection of source generators

Method Detail

getGeneratedType

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


generate

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

See Also:
Generator.generate()


Copyright © 2010. All Rights Reserved.