org.apache.jackrabbit.commons.iterator
Class AbstractLazyIterator<T>

java.lang.Object
  extended by org.apache.jackrabbit.commons.iterator.AbstractLazyIterator<T>
All Implemented Interfaces:
Iterator<T>

public abstract class AbstractLazyIterator<T>
extends Object
implements Iterator<T>

AbstractLazyIterator provides basic iteration methods for a lazy loading iterator that does not support remove. Implementing classes only need to implement the getNext() method which must return the next item in the iteration or null if the iteration as reached its end.


Constructor Summary
protected AbstractLazyIterator()
           
 
Method Summary
protected abstract  T getNext()
          Returns the next element of this iteration or null if the iteration has finished.
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLazyIterator

protected AbstractLazyIterator()
Method Detail

hasNext

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

next

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

getNext

protected abstract T getNext()
Returns the next element of this iteration or null if the iteration has finished.

Returns:
the next element.

remove

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


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.