org.mmbase.util
Class ChainedIterator<E>

java.lang.Object
  extended by org.mmbase.util.ChainedIterator<E>
All Implemented Interfaces:
Iterator<E>

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

Like org.apache.commons.collections.iterators.IteratorChain, to avoid the dependency.... It is quite easy to understand what this actually is. It is an Iterator implemetnation which is based on other Iterators. During iterating, it simply iterates them all sequentially.

Since:
MMBase-1.8
Version:
$Id: ChainedIterator.java 41055 2010-02-15 23:59:16Z michiel $
Author:
Michiel Meeuwissen

Constructor Summary
ChainedIterator()
           
ChainedIterator(Iterator<E>... is)
           
 
Method Summary
 ChainedIterator<E> addIterator(Iterator<E> i)
          Adds another iterator
 boolean hasNext()
           
static void main(String[] argv)
          Just testing
 E next()
           
 void remove()
          Not supported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedIterator

public ChainedIterator()

ChainedIterator

public ChainedIterator(Iterator<E>... is)
Method Detail

addIterator

public ChainedIterator<E> addIterator(Iterator<E> i)
Adds another iterator

Throws:
IllegalStateException - if iteration already started

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()
Not supported

Specified by:
remove in interface Iterator<E>

main

public static void main(String[] argv)
Just testing



MMBase 2.0-SNAPSHOT - null