jlibs.core.util
Class AbstractIterator<T>

java.lang.Object
  extended by jlibs.core.util.AbstractIterator<T>
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
NonNullIterator

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

Abstract Implementation of Iterator. Subclass need to override only computeNext() method.

Author:
Santhosh Kumar T

Field Summary
protected static Object NO_MORE_ELEMENTS
           
 
Constructor Summary
AbstractIterator()
           
 
Method Summary
protected abstract  Object computeNext()
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
protected  AbstractIterator<T> reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MORE_ELEMENTS

protected static final Object NO_MORE_ELEMENTS
Constructor Detail

AbstractIterator

public AbstractIterator()
Method Detail

computeNext

protected abstract Object computeNext()

reset

protected AbstractIterator<T> reset()

hasNext

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

next

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

remove

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


Copyright © 2018. All rights reserved.