edu.umd.cfar.lamp.apploader.misc
Class MultiIterator

java.lang.Object
  extended byedu.umd.cfar.lamp.apploader.misc.MultiIterator
All Implemented Interfaces:
java.util.Iterator

public class MultiIterator
extends java.lang.Object
implements java.util.Iterator

Given an array of iterators, iterates through them.


Constructor Summary
MultiIterator(java.util.Iterator[] iters)
          Constructs a new iterator given the array of iterators to traverse.
 
Method Summary
 boolean hasNext()
          Tests to see if there is another item in this or the next iterator.
 java.lang.Object next()
          Gets the next element in the flattened list of iterators.
 void remove()
          Tries to call the appropriate remove method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiIterator

public MultiIterator(java.util.Iterator[] iters)
Constructs a new iterator given the array of iterators to traverse.

Parameters:
iters - The iterators to exhaust in order
Method Detail

hasNext

public boolean hasNext()
Tests to see if there is another item in this or the next iterator.

Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Gets the next element in the flattened list of iterators.

Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

remove

public void remove()
Tries to call the appropriate remove method.

Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()