org.databene.benerator.dataset
Class CompositeDatasetGenerator<E>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.GeneratorWrapper<Generator<E>,E>
org.databene.benerator.dataset.CompositeDatasetGenerator<E>
- All Implemented Interfaces:
- java.io.Closeable, DatasetBasedGenerator<E>, WeightedDatasetGenerator<E>, Generator<E>, WeightedGenerator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware, org.databene.commons.Weighted
public class CompositeDatasetGenerator<E>
- extends GeneratorWrapper<Generator<E>,E>
- implements WeightedDatasetGenerator<E>
DatasetBasedGenerator
implementation which bases on a composite dataset.
Created: 09.03.2011 11:01:04
- Since:
- 0.6.6
- Author:
- Volker Bergmann
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper |
close, equals, generateFromSource, getSourceWrapper, hashCode, init, isParallelizable, isThreadSafe, reset, setSource, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.databene.commons.ThreadAware |
isParallelizable, isThreadSafe |
Methods inherited from interface org.databene.commons.Resettable |
reset |
CompositeDatasetGenerator
public CompositeDatasetGenerator(java.lang.String nesting,
java.lang.String datasetName,
boolean fallback)
getSource
public WeightedGeneratorGenerator<E> getSource()
- Description copied from class:
GeneratorWrapper
- Returns the source generator
- Overrides:
getSource
in class GeneratorWrapper<Generator<E>,E>
addSubDataset
public void addSubDataset(DatasetBasedGenerator<E> generator,
double weight)
getGeneratedType
public java.lang.Class<E> getGeneratedType()
- Description copied from interface:
Generator
- Declares the type of the objects returned by the generate() method.
- Specified by:
getGeneratedType
in interface Generator<E>
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>
getNesting
public java.lang.String getNesting()
- Specified by:
getNesting
in interface DatasetBasedGenerator<E>
getDataset
public java.lang.String getDataset()
- Specified by:
getDataset
in interface DatasetBasedGenerator<E>
getWeight
public double getWeight()
- Specified by:
getWeight
in interface org.databene.commons.Weighted
generateForDataset
public E generateForDataset(java.lang.String dataset)
- Specified by:
generateForDataset
in interface DatasetBasedGenerator<E>
Copyright © 2013. All Rights Reserved.