org.databene.benerator.sample
Class AbstractSampleGenerator<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
      extended by org.databene.benerator.util.ThreadSafeGenerator<E>
          extended by org.databene.benerator.sample.AbstractSampleGenerator<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
Direct Known Subclasses:
AttachedWeightSampleGenerator, IndividualWeightSampleGenerator, SampleGenerator

public abstract class AbstractSampleGenerator<E>
extends ThreadSafeGenerator<E>

Generates values from a list of samples.

Created: 29.04.2008 07:30:08

Since:
0.5.2
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
AbstractSampleGenerator(java.lang.Class<E> generatedType)
           
 
Method Summary
abstract
<T extends E>
void
addValue(T value)
          Adds a value to the sample list
<T extends E>
void
addValues(java.util.Collection<T> values)
          Adds values to the sample list
<T extends E>
void
addValues(T... values)
          Adds values to the sample list
abstract  void clear()
          Removes all values from the sample list
 java.lang.Class<E> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
abstract  long getVariety()
           
<T extends E>
void
setValues(java.lang.Iterable<T> values)
          Adds values to the sample list
<T extends E>
void
setValues(T... values)
          Sets the sample list to the specified values
 
Methods inherited from class org.databene.benerator.util.ThreadSafeGenerator
isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, close, getResultWrapper, init, reset, toString, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.Generator
generate
 

Constructor Detail

AbstractSampleGenerator

public AbstractSampleGenerator(java.lang.Class<E> generatedType)
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.


setValues

public <T extends E> void setValues(java.lang.Iterable<T> values)
Adds values to the sample list


setValues

public <T extends E> void setValues(T... values)
Sets the sample list to the specified values


addValues

public <T extends E> void addValues(T... values)
Adds values to the sample list


addValues

public <T extends E> void addValues(java.util.Collection<T> values)
Adds values to the sample list


addValue

public abstract <T extends E> void addValue(T value)
Adds a value to the sample list


clear

public abstract void clear()
Removes all values from the sample list


getVariety

public abstract long getVariety()


Copyright © 2013. All Rights Reserved.