<<< Iterator     Index     Iterator Sample >>>

53. Iterator Structure

  • Solution:

      Iterator UML Class Diagram

  • Aggregate defines an interface for creating an Iterator object.

  • ConcreteAggregate implements the Iterator creation and returns instance of the proper ConcreteIterator.

  • Iterator defines an interface for element traversal and access.

  • ConcreteIterator implements the Iterator interface.

  • ConcreteIterator keeps track of the current position in the traversal of the aggregate.

<<< Iterator     Index     Iterator Sample >>>