diva.util
Class IteratorIterator

java.lang.Object
  extended by diva.util.IteratorAdapter
      extended by diva.util.IteratorIterator
All Implemented Interfaces:
Iterator

public abstract class IteratorIterator
extends IteratorAdapter

An iterator that takes an iterator over objects that themselves produce iterators, and which iterators over the elements in the sub-iterators. To get the iterators from the objects iterated over, the method iterator() must be over-ridden to convert a given result from the top-level iterator into a sub-iterator.

Version:
$Revision: 1.4 $
Author:
John Reekie (johnr@eecs.berkeley.edu)

Constructor Summary
IteratorIterator(Iterator i)
           
 
Method Summary
 boolean hasNext()
           
protected abstract  Iterator iterator(Object o)
           
 Object next()
           
 
Methods inherited from class diva.util.IteratorAdapter
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorIterator

public IteratorIterator(Iterator i)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator
Overrides:
hasNext in class IteratorAdapter

iterator

protected abstract Iterator iterator(Object o)

next

public Object next()
Specified by:
next in interface Iterator
Overrides:
next in class IteratorAdapter


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.