Class CloseableIterationSpliterator<T,​E extends java.lang.Exception>

  • All Implemented Interfaces:
    java.util.Spliterator<T>

    class CloseableIterationSpliterator<T,​E extends java.lang.Exception>
    extends java.util.Spliterators.AbstractSpliterator<T>
    A Spliterator implementation that wraps a CloseableIteration.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Spliterator

        java.util.Spliterator.OfDouble, java.util.Spliterator.OfInt, java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive<T extends java.lang.Object,​T_CONS extends java.lang.Object,​T_SPLITR extends java.util.Spliterator.OfPrimitive<T,​T_CONS,​T_SPLITR>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private CloseableIteration<T,​E> iteration  
      • Fields inherited from interface java.util.Spliterator

        CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forEachRemaining​(java.util.function.Consumer<? super T> action)  
      boolean tryAdvance​(java.util.function.Consumer<? super T> action)  
      • Methods inherited from class java.util.Spliterators.AbstractSpliterator

        characteristics, estimateSize, trySplit
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Spliterator

        getComparator, getExactSizeIfKnown, hasCharacteristics
    • Constructor Detail

      • CloseableIterationSpliterator

        public CloseableIterationSpliterator​(CloseableIteration<T,​E> iteration)
        Creates a Spliterator implementation that wraps the supplied CloseableIteration. It handles occurrence of checked exceptions by wrapping them in RuntimeException, and in addition ensures that the wrapped iteration is closed when exhausted.
        Parameters:
        iteration - the iteration to wrap
    • Method Detail

      • tryAdvance

        public boolean tryAdvance​(java.util.function.Consumer<? super T> action)
      • forEachRemaining

        public void forEachRemaining​(java.util.function.Consumer<? super T> action)