This chapter covers the iterator pattern.
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Using iterators, a client object can traverse
a container (or a collection of objects) to access its elements without knowing how these data are stored internally. The concept is very useful when you need to traverse different kinds of collection objects in a standard and uniform way. The following are some important points about this pattern.