Intent
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation
ApplicabilityIn this post, we will be dealing only with the
1. To access an aggregate object's contents without exposing its internal representation.
2. To support multiple traversals of aggregate objects.
3. To provide a uniform interface for traversing different aggregate structures (support polymorphic iteration).
External Iterators
. A typical ExternalIterator
interface is as suchpackage com.devfaqs.designpatterns; public interface ExternalIterator<E> { public boolean hasNext(); public E next(); }
Read more ...