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

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

public class NShotGeneratorProxy<E>
extends GeneratorProxy<E>

Generator proxy which forwards a limited number of products from another generator.

Created: 23.04.2010 17:59:14

Since:
0.6.1
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.GeneratorProxy
generatedType
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
NShotGeneratorProxy(Generator<E> source, long shots)
           
 
Method Summary
 void close()
          Closes the generator.
 ProductWrapper<E> generate(ProductWrapper<E> wrapper)
          Returns an instance of the generic type E, using the ProductWrapper instance provided as argument.
 void reset()
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorProxy
getGeneratedType
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
equals, generateFromSource, getSource, getSourceWrapper, hashCode, init, isParallelizable, isThreadSafe, setSource
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NShotGeneratorProxy

public NShotGeneratorProxy(Generator<E> source,
                           long shots)
Method Detail

generate

public ProductWrapper<E> generate(ProductWrapper<E> 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<E>
Overrides:
generate in class GeneratorProxy<E>

reset

public void reset()
Specified by:
reset in interface org.databene.commons.Resettable
Overrides:
reset in class GeneratorWrapper<E,E>

close

public void close()
Description copied from interface: Generator
Closes the generator. After invocation the state is unavailable.

Specified by:
close in interface java.io.Closeable
Specified by:
close in interface Generator<E>
Overrides:
close in class GeneratorWrapper<E,E>

toString

public java.lang.String toString()
Overrides:
toString in class GeneratorProxy<E>


Copyright © 2013. All Rights Reserved.