org.jcon.data
Class DovetailMultiIterator

java.lang.Object
  extended by org.jcon.data.DovetailMultiIterator
All Implemented Interfaces:
java.util.Iterator, MultiIterator

public class DovetailMultiIterator
extends java.lang.Object
implements MultiIterator

An enumeration that traverses an ordered set of sub-enumerations in breadthwise, round-robin manner. Iterators which empty are removed from the set.

Author:
Paul Reavis sometime before 8/27/97

Constructor Summary
DovetailMultiIterator()
          Creates a new, empty DovetailMultiIterator.
DovetailMultiIterator(java.util.Iterator a, java.util.Iterator b)
          Creates a new DovetailMultiIterator based on two enumerations
 
Method Summary
 void add(java.util.Iterator newEnum)
          Adds an enumeration to the end of the merge enumeration.
 boolean hasNext()
          Returns true if any elements are left in any of the sub-enumerations; false if they're all empty.
 java.lang.Object next()
          Returns the next element of the enumeration.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DovetailMultiIterator

public DovetailMultiIterator()
Creates a new, empty DovetailMultiIterator.


DovetailMultiIterator

public DovetailMultiIterator(java.util.Iterator a,
                             java.util.Iterator b)
Creates a new DovetailMultiIterator based on two enumerations

Method Detail

add

public void add(java.util.Iterator newEnum)
Adds an enumeration to the end of the merge enumeration. May not be accessed until next pass.

Specified by:
add in interface MultiIterator

hasNext

public boolean hasNext()
Returns true if any elements are left in any of the sub-enumerations; false if they're all empty.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Returns the next element of the enumeration. Calls to this method will enumerate successive elements.

Specified by:
next in interface java.util.Iterator
Throws:
java.util.NoSuchElementException - If no more elements exist.

remove

public void remove()
Specified by:
remove in interface java.util.Iterator