package util.nice;
import java.util.NoSuchElementException;
class NiceListEnumeration implements NiceEnumeration {
private NiceListLink cursor = null;
public NiceListEnumeration(NiceList aList) {
cursor = aList.getHead();
}
public boolean hasMoreElements() {
return cursor != null;
}
public Niceable nextElement() throws NoSuchElementException {
if (!hasMoreElements())
throw new NoSuchElementException();
Niceable info = cursor.getInfo();
cursor = cursor.getNext();
return info;
}
}