Interface CloseableSpliterator<T>

  • All Superinterfaces:
    java.lang.AutoCloseable, java.util.Spliterator<T>
    All Known Implementing Classes:
    CloseableSpliteratorMapper, FilterSpliterator, SpliteratorMapper

    public interface CloseableSpliterator<T>
    extends java.util.Spliterator<T>, java.lang.AutoCloseable
    Interface that provides semantics of a Spliterator and AutoCloseable interfaces. This is useful when you have data that can be splitted and may hold resources in the underlying implementation that must be closed.

    A spliterator split from this is not closeable. Only the original CloseableSpliterator is required to be closed

    Some implementations may close resources automatically when the spliterator is exhausted however this is an implementation detail and all callers should call AutoCloseable.close() method to be sure all resources are freed properly.

    Since:
    8.0
    • 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 inherited from interface java.util.Spliterator

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()  
      • Methods inherited from interface java.util.Spliterator

        characteristics, estimateSize, forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics, tryAdvance, trySplit
    • Method Detail

      • close

        void close()
        Specified by:
        close in interface java.lang.AutoCloseable