de.fhdarmstadt.fbi.dtree.testdata
Class GeneratorDataSource

java.lang.Object
  extended byde.fhdarmstadt.fbi.dtree.testdata.GeneratorDataSource
All Implemented Interfaces:
DataSource

public class GeneratorDataSource
extends java.lang.Object
implements DataSource

A DataSource which reads its values from a DataGenerator. The DataGenerator must be initialized outside.


Constructor Summary
GeneratorDataSource(DataGenerator generator, Classification classification)
          Creates a new GeneratorDataSource.
 
Method Summary
 boolean hasNext()
          Checks, whether there is a next element in the datasource.
 TestData next()
          Returns the next element of the datasource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorDataSource

public GeneratorDataSource(DataGenerator generator,
                           Classification classification)
Creates a new GeneratorDataSource. The given generator will be used to generate the test data.

Parameters:
generator - the generator for the test data
classification - the test data's classification
Method Detail

hasNext

public boolean hasNext()
Checks, whether there is a next element in the datasource.

Specified by:
hasNext in interface DataSource
Returns:
true, if there is a next element, false otherwise.

next

public TestData next()
              throws java.util.NoSuchElementException
Returns the next element of the datasource. Subsequent calls to next return all element from the datasource.

Specified by:
next in interface DataSource
Returns:
the next test data element.
Throws:
java.util.NoSuchElementException - if there is no next element.