Iterator
Usage
- Also known as: Cursor
- Sequentially access the elements of a collection
- Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation
Participants
Iterator
ConcreteIterator
- Defines an interface for accessing and traversing elements.
Aggregate
- Implements the Iterator interface.
- Keeps track of the current position in the traversal of the aggregate.
ConcreteAggregate
- Defines an interface for creating an Iterator object.
- Implements the Iterator creation interface to return an instance of the proper ConcreteIterator.
