git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@436986
13f79535-47bb-0310-9956-
ffa450edef68
import java.util.HashMap;
import java.util.Iterator;
+import java.util.NoSuchElementException;
/**
* High level representation of a row of a spreadsheet.
private class CellIterator implements Iterator
{
- int thisId,nextId=0;
+ int thisId=-1;
+ int nextId=-1;
public CellIterator()
{
}
public Object next() {
+ if (!hasNext())
+ throw new NoSuchElementException("At last element");
HSSFCell cell=cells[nextId];
thisId=nextId;
findNext();
}
public void remove() {
+ if (thisId == -1)
+ throw new IllegalStateException("remove() called before next()");
cells[thisId]=null;
}