Package net.sourceforge.pmd.util
Class IteratorUtil.AbstractIterator<T>
java.lang.Object
net.sourceforge.pmd.util.IteratorUtil.AbstractIterator<T>
- Type Parameters:
T- the type of the elements
- All Implemented Interfaces:
Iterator<T>
- Direct Known Subclasses:
IteratorUtil.AbstractPausingIterator
- Enclosing class:
IteratorUtil
Note, that this iterator doesn't support the
remove operation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidCompute the next element.protected final voiddone()booleanhasNext()next()final voidremove()This implementation throws an instance ofUnsupportedOperationExceptionand performs no other action.protected final voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
AbstractIterator
public AbstractIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
setNext
-
done
protected final void done() -
computeNext
protected abstract void computeNext()Compute the next element. Implementations must call eitherdone()orsetNext(Object)exactly once. -
remove
public final void remove()This implementation throws an instance ofUnsupportedOperationExceptionand performs no other action.- Specified by:
removein interfaceIterator<T>- Throws:
UnsupportedOperationException- always, as theremoveoperation is not supported by this iterator
-