Class IteratorUtils

java.lang.Object
uk.ac.ebi.utils.collections.IteratorUtils

public class IteratorUtils extends Object
Author:
Marco Brandizi
Date:
7 Oct 2024
  • Method Details

    • supplier2Iterator

      public static <E> Iterator<E> supplier2Iterator(Supplier<? extends E> supplier)
      Builds an Iterator of non-null based on a supplier.
      Parameters:
      supplier - provides an element every time the resulting interator requests for it. The first time this offers a null, the iterator starts returning false in Iterator.hasNext() and the iteration is over.