1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.jameleon.data;
21
22 import java.io.IOException;
23
24 import java.util.Map;
25
26 /***
27 * This interface is used to implement different ways to get
28 * data from a source. Some examples might be a database, an xml
29 * file or even an Excel spreadsheet (besides just using a CSV file).
30 */
31 public interface DataDriver{
32
33 /***
34 * Opens the handle to the data source
35 * @throws IOException when the data source can not be found.
36 */
37 public void open() throws IOException;
38
39 /***
40 * Closes the handle to the data source
41 */
42 public void close();
43
44 /***
45 * Gets the next row from the data source
46 * @return a key-value HashMap representing the data row or null if
47 * no data row is available
48 */
49 public Map getNextRow();
50
51 /***
52 * Tells whether the data source has another row
53 * @return true if the data source still has more rows
54 */
55 public boolean hasMoreRows();
56
57 }