An IteratorChain is an Iterator that wraps a number of Iterators.
This class makes multiple iterators look like one to the caller When any method from the Iterator interface is called, the IteratorChain will delegate to a single underlying Iterator. The IteratorChain will invoke the Iterators in sequence until all Iterators are exhausted.
Under many circumstances, linking Iterators together in this manner is more efficient (and convenient) than reading out the contents of each Iterator into a List and creating a new Iterator.
Calling a method that adds new Iterator
after a method in the Iterator interface has been called will result in an UnsupportedOperationException. Subclasses should
take care to not alter the underlying List of Iterators.
NOTE: As from version 3.0, the IteratorChain may contain no iterators. In this case the class will function as an empty iterator.
@author Morgan Delagrange
@author Matt Hall, John Watkinson, Stephen Colebourne
@version $Revision: 1.1 $ $Date: 2005/10/11 17:05:24 $
@since Commons Collections 2.1