Class AbstractIterator<E>

java.lang.Object
org.apache.sis.internal.util.AbstractIterator<E>
Type Parameters:
E - the type of elements to be returned by the iterator.
All Implemented Interfaces:
Iterator<E>
Direct Known Subclasses:
AttributeTypeBuilder.RoleIter, LazySynchronizedIterator

public abstract class AbstractIterator<E> extends Object implements Iterator<E>
Base class for iterators that prepare the next element in advance. The next field is initially null and is reset to null after each call to next(). The Iterator.hasNext() method shall set the next field to a non-null value if there is more elements to return.
Since:
0.7
Version:
0.7
  • Field Details

    • next

      protected E next
      The next value to be returned by next(), or null if not yet determined. This field should be set by a non-null value by Iterator.hasNext(), unless there are no more elements.
  • Constructor Details

    • AbstractIterator

      protected AbstractIterator()
      For subclass constructors.
  • Method Details

    • next

      public E next()
      Returns the next element in this iteration.
      Specified by:
      next in interface Iterator<E>
      Returns:
      the next element.