net.ontopia.utils
Class IteratorIterator<T>

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

public class IteratorIterator<T>
extends java.lang.Object
implements java.util.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  java.util.Iterator<java.util.Iterator<T>> colls_iter
           
protected  java.util.Iterator<T> iter
           
 
Constructor Summary
IteratorIterator(java.util.Collection<java.util.Collection<T>> colls_or_iters)
           
IteratorIterator(java.util.Iterator<java.util.Iterator<T>> colls_or_iters)
           
 
Method Summary
protected  java.util.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 java.util.Iterator<java.util.Iterator<T>> colls_iter

iter

protected java.util.Iterator<T> iter
Constructor Detail

IteratorIterator

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

IteratorIterator

public IteratorIterator(java.util.Iterator<java.util.Iterator<T>> colls_or_iters)
Method Detail

getNextIterator

protected java.util.Iterator<T> getNextIterator()

hasNext

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

next

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

remove

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


Copyright © 2000-2012 Ontopia.