SE450: Iterator Pattern [12/72] Previous pageContentsNext page

Solution

  1. Define an iterator that fetches one element at a time
  2. Each iterator object keeps track of the position of the next element
  3. If there are several aggregate/iterator variations, it is best if the aggregate and iterator classes realize common interface types.

Previous pageContentsNext page