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
public abstract static class IteratorUtil.AbstractIterator<T> extends Object implements Iterator<T>
Note, that this iterator doesn't support theremoveoperation.
-
-
Constructor Summary
Constructors Constructor Description AbstractIterator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcomputeNext()Compute the next element.protected voiddone()booleanhasNext()Tnext()voidremove()This implementation throws an instance ofUnsupportedOperationExceptionand performs no other action.protected voidsetNext(T t)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
setNext
protected final void setNext(T t)
-
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
-
-