package util.nice;
import java.util.NoSuchElementException;
public class NiceVectorEnumeration implements NiceEnumeration {
private NiceVector vect = null;
private int cursor = 0;
public NiceVectorEnumeration(NiceVector v) {
vect = v;
}
public boolean hasMoreElements() {
return cursor < vect.getSize();
}
public Niceable nextElement() throws NoSuchElementException {
if (!hasMoreElements())
throw new NoSuchElementException();
return vect.getElementAt(cursor++);
}
}