Interface BlockingSpliterator<T>

  • Type Parameters:
    T - the type of elements returned by this Spliterator.
    All Superinterfaces:
    java.lang.AutoCloseable, java.util.Spliterator<T>

    public interface BlockingSpliterator<T>
    extends java.util.Spliterator<T>, java.lang.AutoCloseable
    An Spliterator which supports AutoCloseable.close().
    • 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()
      This method is used to communicate that you are no longer interested in consuming data.
      BlockingSpliterator<T> trySplit()  
      • Methods inherited from interface java.util.Spliterator

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

      • trySplit

        BlockingSpliterator<T> trySplit()
        Specified by:
        trySplit in interface java.util.Spliterator<T>
      • close

        void close()
            throws java.lang.Exception
        This method is used to communicate that you are no longer interested in consuming data. This provides a "best effort" notification to the producer of data that you are no longer interested in data from this Spliterator.

        If all the data has not been consumed this may have transport implications (e.g. if the source of data comes from a socket or file descriptor). If all data has been consumed, or this BlockingIterator has previously been closed this should be a noop.

        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception