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 Iteratorafter 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.
since: Commons Collections 2.1 version: $Revision: 171347 $ $Date: 2005-05-22 18:27:34 +0100 (Sun, 22 May 2005) $ author: Morgan Delagrange author: Stephen Colebourne |