|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.databene.benerator.util.AbstractGenerator<E>
org.databene.benerator.util.ThreadSafeGenerator<E>
org.databene.benerator.sample.AbstractSampleGenerator<E>
org.databene.benerator.sample.IndividualWeightGenerator<E>
public class IndividualWeightGenerator<E>
Generator for IndividualWeight distributions.
Created at 01.07.2009 11:48:23
| Field Summary |
|---|
| Fields inherited from class org.databene.benerator.util.AbstractGenerator |
|---|
context, state |
| Constructor Summary | |
|---|---|
IndividualWeightGenerator()
Initializes the generator to an empty sample list |
|
IndividualWeightGenerator(java.lang.Class<E> generatedType,
IndividualWeight<E> distribution,
E... values)
Initializes the generator to an unweighted sample list |
|
IndividualWeightGenerator(java.lang.Class<E> generatedType,
IndividualWeight<E> distribution,
java.lang.Iterable<E> values)
Initializes the generator to an unweighted sample list |
|
| Method Summary | ||
|---|---|---|
|
addValue(T value)
Adds an unweighted value to the sample list |
|
void |
clear()
Removes all values from the sample list |
|
E |
generate()
Returns an instance of the generic type E. |
|
static
|
generate(java.util.List<T> samples)
Convenience utility method that chooses one sample out of a list with uniform random distribution |
|
static
|
generate(T... samples)
Convenience utility method that chooses one sample out of a list with uniform random distribution |
|
java.lang.Class<E> |
getGeneratedType()
Declares the type of the objects returned by the generate() method. |
|
java.util.List<E> |
getSamples()
returns the sample list |
|
void |
init(GeneratorContext context)
Initializes all attributes |
|
void |
setSamples(java.util.Collection<E> samples)
Adds weighted values to the sample list |
|
void |
setSamples(E... samples)
Sets the sample list to the specified weighted values |
|
java.lang.String |
toString()
|
|
| Methods inherited from class org.databene.benerator.sample.AbstractSampleGenerator |
|---|
addValues, addValues, setValues, setValues |
| Methods inherited from class org.databene.benerator.util.ThreadSafeGenerator |
|---|
isParallelizable, isThreadSafe |
| Methods inherited from class org.databene.benerator.util.AbstractGenerator |
|---|
assertInitialized, assertNotInitialized, close, reset, wasInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IndividualWeightGenerator()
public IndividualWeightGenerator(java.lang.Class<E> generatedType,
IndividualWeight<E> distribution,
E... values)
public IndividualWeightGenerator(java.lang.Class<E> generatedType,
IndividualWeight<E> distribution,
java.lang.Iterable<E> values)
| Method Detail |
|---|
public java.util.List<E> getSamples()
public void setSamples(E... samples)
public void setSamples(java.util.Collection<E> samples)
public <T extends E> void addValue(T value)
addValue in class AbstractSampleGenerator<E>public void clear()
AbstractSampleGenerator
clear in class AbstractSampleGenerator<E>public java.lang.Class<E> getGeneratedType()
Generator
getGeneratedType in interface Generator<E>getGeneratedType in class AbstractSampleGenerator<E>public void init(GeneratorContext context)
init in interface Generator<E>init in class AbstractGenerator<E>public E generate()
Generator
Generator.generate()public static <T> T generate(T... samples)
public static <T> T generate(java.util.List<T> samples)
public java.lang.String toString()
toString in class AbstractGenerator<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||