The advance() method usually just replaces the current entry by the rest member of the current entry. However, when this value is null, the advance must proceed to the first entry on the next non-empty hash list of the table. This is accomplished by the protected method nextList(). This method is also used to initialize a TableIterator, after first setting its index to -1.
The currentData(), currentKey(), and advance() methods all call more() before doing anything else in order to check their preconditions. If this check fails then the program is terminated with an error message.
increment currentList while currentList < number of hash lists if table.hashLists[currentList] is not null set currentEntry to table.hashLists[currentList] break increment currentList
parameter: Table tbl set table to tbl set currentList to -1 call startNextList
return index < number of hash lists
if more() is false terminate program with precondition violation error message advance currentEntry to next entry in list if currentEntry is null call startNextList
if more() is false terminate program with precondition violation error message return currentEntry.key
if more() is false terminate program with precondition violation error message return currentEntry.data