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 theremove
operation.
-
-
Constructor Summary
Constructors Constructor Description AbstractIterator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
computeNext()
Compute the next element.protected void
done()
boolean
hasNext()
T
next()
void
remove()
This implementation throws an instance ofUnsupportedOperationException
and performs no other action.protected void
setNext(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 ofUnsupportedOperationException
and performs no other action.- Specified by:
remove
in interfaceIterator<T>
- Throws:
UnsupportedOperationException
- always, as theremove
operation is not supported by this iterator
-
-