Iterator Class

This slide shows the class description for an iterator class. The iterator is permitted access to the inner workings of the collection, in this case to the link fields. It holds a current link, and moves through the list by changing the current link pointer. When asked for the current value, it returns the value held by the current link.

Again, we will have more to say about iterators in the next chapter.

[audio] [real] Text to accompany slide19, in Chapter 15 of An Introduction to Object-Oriented Programming