Class Infinite<T>

java.lang.Object
org.dmfs.jems2.iterator.Infinite<T>
All Implemented Interfaces:
Iterator<T>

public final class Infinite<T> extends Object implements Iterator<T>
An Generator to Iterator adapter which iterates infinitely. Be careful when using this with a while loop and make sure there is another exit point.
  • Constructor Details

    • Infinite

      public Infinite(Generator<T> generator)
  • Method Details

    • hasNext

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

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