This pattern allows you to access elements from a collection in a sequential order without disclosing the underlying structure. It has read-only access and no access to the internal collection.
Examples of iterator patterns include:
The classes, interfaces, & objects in the above UML class diagram are defined as follows.
The iterator design pattern is useful for the following cases: