org.inria.ns.reflex.util
Class CollectionsHelper.DeferredIterator

java.lang.Object
  extended by org.inria.ns.reflex.util.CollectionsHelper.DeferredIterator
All Implemented Interfaces:
Iterator
Enclosing class:
CollectionsHelper

public abstract static class CollectionsHelper.DeferredIterator
extends Object
implements Iterator

A deferred Iterator.

When the creation of an iterator is time-consuming, it may be convenient to use this class if there is a chance that the next() method won't be called. It might be the case when several iterators have to be cumulated and when only the first items are really needed.


Constructor Summary
CollectionsHelper.DeferredIterator()
           
 
Method Summary
 boolean hasNext()
          The first time this method is called cause the creation of the iterator.
 Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionsHelper.DeferredIterator

public CollectionsHelper.DeferredIterator()
Method Detail

hasNext

public boolean hasNext()
The first time this method is called cause the creation of the iterator.

Specified by:
hasNext in interface Iterator
See Also:
createIterator(), Iterator.hasNext()

next

public Object next()
Specified by:
next in interface Iterator
See Also:
Iterator.next()

remove

public void remove()
Specified by:
remove in interface Iterator
See Also:
Iterator.remove()