com.phoenixst.collections

Class IteratorChain

public class IteratorChain extends Object implements Iterator

A chain of Iterators. The one in Jakarta commons-collections doesn't work.

This is similar to the class of the same name in Jakarta Commons-Collections 3.0. This implementation is missing all of the locking and safeguards of the other one. This implementation fixes a bug in version 2.1 where hasNext() would return false if the first iterator was empty, but subsequent ones were not.

Since: 1.0

Version: $Revision: 1.11 $

Author: Ray A. Conner

Constructor Summary
IteratorChain(Iterator[] iterators)
Creates a new IteratorChain.
IteratorChain(Collection iterators)
Creates a new IteratorChain.
IteratorChain(Iterator first, Iterator second)
Creates a new IteratorChain.
Method Summary
booleanhasNext()
Objectnext()
voidremove()

Constructor Detail

IteratorChain

public IteratorChain(Iterator[] iterators)
Creates a new IteratorChain.

IteratorChain

public IteratorChain(Collection iterators)
Creates a new IteratorChain.

IteratorChain

public IteratorChain(Iterator first, Iterator second)
Creates a new IteratorChain.

Method Detail

hasNext

public boolean hasNext()

next

public Object next()

remove

public void remove()
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.