Class CloseableIteratorUtils


  • public final class CloseableIteratorUtils
    extends java.lang.Object
    Helper class for CloseableIterators
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​R>
      CloseableIterator<R>
      map​(CloseableIterator<T> closeableIterator, java.util.function.Function<? super T,​? extends R> mapper)
      Maps a CloseableIterator from un input type T to an output type R using a mapper function.
      static <E> CloseableIterator<E> toCloseableIterator​(java.lang.Iterable<E> iterable)
      Converts an Iterable to a CloseableIterator.
      static <E> CloseableIterator<E> toCloseableIterator​(java.util.Iterator<E> iterator)
      Converts an Iterator to a CloseableIterator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • map

        public static <T,​R> CloseableIterator<R> map​(CloseableIterator<T> closeableIterator,
                                                           java.util.function.Function<? super T,​? extends R> mapper)
        Maps a CloseableIterator from un input type T to an output type R using a mapper function.
      • toCloseableIterator

        public static <E> CloseableIterator<E> toCloseableIterator​(java.util.Iterator<E> iterator)
        Converts an Iterator to a CloseableIterator. The close methods does nothing.
      • toCloseableIterator

        public static <E> CloseableIterator<E> toCloseableIterator​(java.lang.Iterable<E> iterable)
        Converts an Iterable to a CloseableIterator. The close methods does nothing.