back home

Iterator Pattern

[behavioral-patterns][design-patterns]

The Iterator pattern is basically an extration of a traversal method over some data structure. The iterator interface declares general methods of traversal - getting the next or previous item, getting item at some specific index. Then, concrete implementations provide those methods for a specific data structure they are being implemented on.