Interface Iterators.PreviewIterator<T>

  • Type Parameters:
    T - the type of value
    All Superinterfaces:
    Iterator<T>
    Enclosing class:
    Iterators

    public static interface Iterators.PreviewIterator<T>
    extends Iterator<T>
    A read only iterator that is able to preview the next value without consuming it or altering the behavior or semantics of the normal Iterator methods.
    • Method Detail

      • peek

        T peek()
        Peek at the next value without consuming or using it. This method returns the same value if called multiple times between Iterator.next().
        Returns:
        the next value, or null if there are no more