Class Endless<T>

  • Type Parameters:
    T - Element type
    All Implemented Interfaces:
    Iterator<T>

    public final class Endless<T>
    extends Object
    implements Iterator<T>
    Iterator that never ends.

    If you need to repeat certain amount of time, use Repeated.

    Since:
    0.4
    • Constructor Detail

      • Endless

        public Endless​(T element)
        Ctor.
        Parameters:
        element - Element to repeat
      • Endless

        public Endless​(Scalar<? extends T> scalar)
        Ctor.
        Parameters:
        scalar - Scalar to repeat
    • Method Detail

      • hasNext

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

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