org.databene.benerator.wrapper
Class MultiGeneratorWrapper<S,P>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.MultiGeneratorWrapper<S,P>
- All Implemented Interfaces:
- java.io.Closeable, Generator<P>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
- Direct Known Subclasses:
- AlternativeGenerator, GeneratorChain, SimpleMultiSourceArrayGenerator, UniqueMultiSourceArrayGenerator, UniqueScrambledStringGenerator, WeightedGeneratorGenerator
public abstract class MultiGeneratorWrapper<S,P>
- extends AbstractGenerator<P>
Parent class for wrapping several other generators (in a sources property)
and refining a composite state from them.
Created: 19.12.2006 07:05:29
- Since:
- 0.1
- Author:
- Volker Bergmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
generatedType
protected java.lang.Class<P> generatedType
sources
protected java.util.List<Generator<? extends S>> sources
MultiGeneratorWrapper
public MultiGeneratorWrapper(java.lang.Class<P> generatedType,
Generator<? extends S>... sources)
MultiGeneratorWrapper
public MultiGeneratorWrapper(java.lang.Class<P> generatedType,
java.util.List<Generator<? extends S>> sources)
getSources
public java.util.List<Generator<? extends S>> getSources()
setSources
public void setSources(java.util.List<Generator<? extends S>> sources)
getSource
public Generator<? extends S> getSource(int index)
addSource
public void addSource(Generator<? extends S> source)
availableSourceCount
protected int availableSourceCount()
getAvailableSource
protected Generator<? extends S> getAvailableSource(int index)
getGeneratedType
public java.lang.Class<P> 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<P>
- Overrides:
init
in class AbstractGenerator<P>
reset
public void reset()
- Specified by:
reset
in interface org.databene.commons.Resettable
- Overrides:
reset
in class AbstractGenerator<P>
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<P>
- Overrides:
close
in class AbstractGenerator<P>
isThreadSafe
public boolean isThreadSafe()
isParallelizable
public boolean isParallelizable()
getSourceWrapper
protected ProductWrapper<S> getSourceWrapper()
generateFromRandomSource
protected ProductWrapper<S> generateFromRandomSource(ProductWrapper<S> wrapper)
generateFromSource
protected ProductWrapper<java.lang.String> generateFromSource(int index,
ProductWrapper<S> wrapper)
generateFromAvailableSource
protected ProductWrapper<S> generateFromAvailableSource(int i,
ProductWrapper<S> wrapper)
generateFromAllSources
protected S[] generateFromAllSources(java.lang.Class<S> componentType)
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractGenerator<P>
Copyright © 2013. All Rights Reserved.