net.ontopia.utils
Class IteratorIterator<T>

java.lang.Object
  extended by net.ontopia.utils.IteratorIterator<T>
All Implemented Interfaces:
Iterator<T>

public class IteratorIterator<T>
extends Object
implements Iterator<T>

INTERNAL: An iterator that works as a facade for multiple iterators. The iterator represents the sum of all the iterators.


Field Summary
protected  Iterator<Iterator<T>> colls_iter
           
protected  Iterator<T> iter
           
 
Constructor Summary
IteratorIterator(Collection<Collection<T>> colls_or_iters)
           
IteratorIterator(Iterator<Iterator<T>> colls_or_iters)
           
 
Method Summary
protected  Iterator<T> getNextIterator()
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colls_iter

protected Iterator<Iterator<T>> colls_iter

iter

protected Iterator<T> iter
Constructor Detail

IteratorIterator

public IteratorIterator(Collection<Collection<T>> colls_or_iters)
Parameters:
colls_or_iters - a collection of collections or iterators.

IteratorIterator

public IteratorIterator(Iterator<Iterator<T>> colls_or_iters)
Method Detail

getNextIterator

protected Iterator<T> getNextIterator()

hasNext

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

next

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

remove

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


Copyright © 2000-2012 Ontopia.