[an error occurred while processing this directive]

TableIterator Module Implementation Specifications


Client Specifications

Implementation Data Model

A TableIterator is an object that contains a reference to the Table that it is iterating, an index into the array of hash lists for the Table, and a reference to the current entry for the TableIterator. The more() method returns true when the array index is a valid index into the array of hash lists. The currentData() and currentKey() methods return data and keys accessed through the current entry reference.

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.

Instance Variables

Private Method Specifications

Private Method Algorithms

Public Method Algorithms

[an error occurred while processing this directive]