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 the remove operation.
  • Constructor Details

    • AbstractIterator

      public AbstractIterator()
  • Method Details

    • hasNext

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

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

      protected final void setNext(T t)
    • done

      protected final void done()
    • computeNext

      protected abstract void computeNext()
      Compute the next element. Implementations must call either done() or setNext(Object) exactly once.
    • remove

      public final void remove()
      This implementation throws an instance of UnsupportedOperationException and performs no other action.
      Specified by:
      remove in interface Iterator<T>
      Throws:
      UnsupportedOperationException - always, as the remove operation is not supported by this iterator