Class First<T>

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

public final class First<T> extends Object implements Iterator<T>
An Iterator which returns the first few elements of a delegate Iterator or Generator.
  • Constructor Details

    • First

      public First(int remaining, Generator<T> delegate)
    • First

      public First(int remaining, Iterator<T> delegate)
  • Method Details

    • hasNext

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

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