changes: now Inference engine works fine with the EyeTracking benchmark.
[IRC.git] / Robust / src / ClassLibrary / VectorIterator.java
1 public class VectorIterator extends Iterator {
2   private int pos;
3   private int size;
4   private Vector list;
5
6   public VectorIterator(Vector v) {
7     this.list = v;
8     this.pos = 0;
9     this.size = this.list.size();
10   }
11
12   /**
13    * Tests to see if there are any more objects to
14    * return.
15    *
16    * @return True if the end of the list has not yet been
17    *         reached.
18    */
19   public boolean hasNext() {
20     return pos < size;
21   }
22
23   /**
24    * Retrieves the next object from the list.
25    *
26    * @return The next object.
27    */
28   public Object next() {
29     if (pos == size) {
30       return null;  //since we can't throw anything...
31     }
32     return this.list.get(pos++);
33   }
34 }