de.fhdarmstadt.fbi.dtree.testdata
Class ListDataSource

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

public class ListDataSource
extends java.lang.Object
implements DataSource

A datasource over an array of test data elements.


Constructor Summary
ListDataSource(TestData[] list)
          Creates a new DataSource for the given array.
 
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

ListDataSource

public ListDataSource(TestData[] list)
Creates a new DataSource for the given array.

Parameters:
list - the data.
Throws:
java.lang.NullPointerException - if the given data is null.
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()
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.