import
java.util.Iterator;
class OpenListIterator implements Iterator
{
private OpenList
remainder;
public
OpenListIterator(OpenList theList)// constructor
{
remainder = theList;
}
public boolean
hasNext()
{
return remainder.nonEmpty();
}
public Object next()
{
Object result = remainder.first();
theList = remainder.rest();
return result;
}
public void remove()
{
throw new UnsupportedOperationException();
}