Class AbstractSequentialIterator<T>

java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractSequentialIterator<T>
All Implemented Interfaces:
Iterator<T>

@GwtCompatible @Deprecated(since="2022-12-01") public abstract class AbstractSequentialIterator<T> extends UnmodifiableIterator<T>
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
This class provides a skeletal implementation of the Iterator interface for sequences whose next element can always be derived from the previous element. Null elements are not supported, nor is the UnmodifiableIterator.remove() method.

Example:

   

    Iterator<Integer> powersOfTwo =
        new AbstractSequentialIterator<Integer>(1) {
          protected Integer computeNext(Integer previous) {
            return (previous == 1 << 30) ? null : previous * 2;
          }
        };
Since:
12.0 (in Guava as AbstractLinkedIterator since 8.0)
  • Method Details

    • hasNext

      public final boolean hasNext()
      Deprecated.
    • next

      public final T next()
      Deprecated.