de.lmu.ifi.dbs.elki.utilities.iterator
Class MergedIterator<E>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.iterator.MergedIterator<E>
Type Parameters:
E - Entry type
All Implemented Interfaces:
Iterator<E>

public class MergedIterator<E>
extends Object
implements Iterator<E>

Iterator that joins multiple existing iterators into one.


Field Summary
(package private)  Iterator<E> current
          The iterator we are currently processing
(package private)  Iterator<Iterator<E>> iterators
          All the iterators we process
(package private)  Iterator<E> last
          The last iterator we returned an object for, for remove()
 
Constructor Summary
MergedIterator(Collection<Iterator<E>> iterators)
          Auxillary constructor with Collections
MergedIterator(Iterator<E>... iterators)
          Auxillary constructor with arrays
MergedIterator(Iterator<Iterator<E>> iterators)
          Main constructor.
 
Method Summary
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterators

final Iterator<Iterator<E>> iterators
All the iterators we process


current

Iterator<E> current
The iterator we are currently processing


last

Iterator<E> last
The last iterator we returned an object for, for remove()

Constructor Detail

MergedIterator

public MergedIterator(Iterator<Iterator<E>> iterators)
Main constructor.

Parameters:
iterators - Iterators

MergedIterator

public MergedIterator(Collection<Iterator<E>> iterators)
Auxillary constructor with Collections

Parameters:
iterators - Iterators

MergedIterator

public MergedIterator(Iterator<E>... iterators)
Auxillary constructor with arrays

Parameters:
iterators - Iterators
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

next

public E next()
Specified by:
next in interface Iterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>

Release 0.4.0 (2011-09-20_1324)