Class AbstractLazyIterator<T>

  • All Implemented Interfaces:

    public abstract class AbstractLazyIterator<T>
    extends Object
    implements Iterator<T>
    AbstractLazyIterator provides basic iteration methods for a lazy loading iterator that does not support remove. Implementing classes only need to implement the getNext() method which must return the next item in the iteration or null if the iteration as reached its end.
    • Constructor Detail

      • AbstractLazyIterator

        protected AbstractLazyIterator()
    • Method Detail

      • hasNext

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

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

        protected abstract T getNext()
        Returns the next element of this iteration or null if the iteration has finished.
        the next element.
      • remove

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