Wednesday, November 2, 2011

Iterator Pattern

A design pattern that uses an iterator to traverse the elements of some collection without exposing its underlying implementation.

Examples:
Iterators can be used to traverse linked lists, trees, maps, etc. Same interface, different underlying implementation.

Interface for Iterator/Main methods on Iterator:
hasNext()
next()
remove()

No comments:

Post a Comment