01: package test.dataprovider;
02:
03: import java.util.Iterator;
04:
05: class MyIterator implements Iterator {
06: private static int m_count = 0;
07: private Object[] m_data;
08:
09: public MyIterator(Object[] data) {
10: m_data = data;
11: m_count = 0;
12: }
13:
14: public boolean hasNext() {
15: return m_count < m_data.length;
16: }
17:
18: public Object next() {
19: // ppp("RETURNING INDEX " + m_count);
20: return m_data[m_count++];
21: }
22:
23: public void remove() {
24: }
25:
26: public static int getCount() {
27: return m_count;
28: }
29:
30: private static void ppp(String s) {
31: System.out.println("[MyIterator] " + s);
32: }
33:
34: }
|