Interface Sequenceable<E>

  • Type Parameters:
    E - The type of element in the sequence.

    public interface Sequenceable<E>
    An object that can appear in a sequence, able to provide the next object in the sequence.

    This interface differs from Iterator in the semantics of the "get next" functionality. An Iterator is an independent object that returns different next objects after successive calls. A Sequenceable is an object that is part of a sequence, which will always return the successive object after this (which will seldom change).

    Author:
    Garret Wilson
    See Also:
    Iterator
    • Method Detail

      • hasNext

        boolean hasNext()
        Returns:
        true if there is an object after this one in the sequence.
      • getNext

        E getNext()
        Returns:
        The next object in the sequence, which need not be constant.