Class IntStreamDecorator

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>, java.util.stream.IntStream

    public class IntStreamDecorator
    extends java.lang.Object
    implements java.util.stream.IntStream
    The IntStreamDecorator wraps a Java IntStream and registers a closeHandler which is passed further to any resulting Stream.

    The goal of the IntStreamDecorator is to close the underlying IntStream upon calling a terminal operation.

    Since:
    5.4
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.stream.IntStream

        java.util.stream.IntStream.Builder
    • Constructor Summary

      Constructors 
      Constructor Description
      IntStreamDecorator​(java.util.stream.IntStream delegate, java.lang.Runnable closeHandler)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allMatch​(java.util.function.IntPredicate predicate)  
      boolean anyMatch​(java.util.function.IntPredicate predicate)  
      java.util.stream.DoubleStream asDoubleStream()  
      java.util.stream.LongStream asLongStream()  
      java.util.OptionalDouble average()  
      java.util.stream.Stream<java.lang.Integer> boxed()  
      void close()  
      <R> R collect​(java.util.function.Supplier<R> supplier, java.util.function.ObjIntConsumer<R> accumulator, java.util.function.BiConsumer<R,​R> combiner)  
      long count()  
      java.util.stream.IntStream distinct()  
      java.util.stream.IntStream filter​(java.util.function.IntPredicate predicate)  
      java.util.OptionalInt findAny()  
      java.util.OptionalInt findFirst()  
      java.util.stream.IntStream flatMap​(java.util.function.IntFunction<? extends java.util.stream.IntStream> mapper)  
      void forEach​(java.util.function.IntConsumer action)  
      void forEachOrdered​(java.util.function.IntConsumer action)  
      boolean isParallel()  
      java.util.PrimitiveIterator.OfInt iterator()  
      java.util.stream.IntStream limit​(long maxSize)  
      java.util.stream.IntStream map​(java.util.function.IntUnaryOperator mapper)  
      java.util.stream.DoubleStream mapToDouble​(java.util.function.IntToDoubleFunction mapper)  
      java.util.stream.LongStream mapToLong​(java.util.function.IntToLongFunction mapper)  
      <U> java.util.stream.Stream<U> mapToObj​(java.util.function.IntFunction<? extends U> mapper)  
      java.util.OptionalInt max()  
      java.util.OptionalInt min()  
      boolean noneMatch​(java.util.function.IntPredicate predicate)  
      java.util.stream.IntStream onClose​(java.lang.Runnable closeHandler)  
      java.util.stream.IntStream parallel()  
      java.util.stream.IntStream peek​(java.util.function.IntConsumer action)  
      int reduce​(int identity, java.util.function.IntBinaryOperator op)  
      java.util.OptionalInt reduce​(java.util.function.IntBinaryOperator op)  
      java.util.stream.IntStream sequential()  
      java.util.stream.IntStream skip​(long n)  
      java.util.stream.IntStream sorted()  
      java.util.Spliterator.OfInt spliterator()  
      int sum()  
      java.util.IntSummaryStatistics summaryStatistics()  
      int[] toArray()  
      java.util.stream.IntStream unordered()  
      • Methods inherited from class java.lang.Object

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

        dropWhile, takeWhile
    • Constructor Detail

      • IntStreamDecorator

        public IntStreamDecorator​(java.util.stream.IntStream delegate,
                                  java.lang.Runnable closeHandler)
    • Method Detail

      • filter

        public java.util.stream.IntStream filter​(java.util.function.IntPredicate predicate)
        Specified by:
        filter in interface java.util.stream.IntStream
      • map

        public java.util.stream.IntStream map​(java.util.function.IntUnaryOperator mapper)
        Specified by:
        map in interface java.util.stream.IntStream
      • mapToObj

        public <U> java.util.stream.Stream<U> mapToObj​(java.util.function.IntFunction<? extends U> mapper)
        Specified by:
        mapToObj in interface java.util.stream.IntStream
      • mapToLong

        public java.util.stream.LongStream mapToLong​(java.util.function.IntToLongFunction mapper)
        Specified by:
        mapToLong in interface java.util.stream.IntStream
      • mapToDouble

        public java.util.stream.DoubleStream mapToDouble​(java.util.function.IntToDoubleFunction mapper)
        Specified by:
        mapToDouble in interface java.util.stream.IntStream
      • flatMap

        public java.util.stream.IntStream flatMap​(java.util.function.IntFunction<? extends java.util.stream.IntStream> mapper)
        Specified by:
        flatMap in interface java.util.stream.IntStream
      • distinct

        public java.util.stream.IntStream distinct()
        Specified by:
        distinct in interface java.util.stream.IntStream
      • sorted

        public java.util.stream.IntStream sorted()
        Specified by:
        sorted in interface java.util.stream.IntStream
      • peek

        public java.util.stream.IntStream peek​(java.util.function.IntConsumer action)
        Specified by:
        peek in interface java.util.stream.IntStream
      • limit

        public java.util.stream.IntStream limit​(long maxSize)
        Specified by:
        limit in interface java.util.stream.IntStream
      • skip

        public java.util.stream.IntStream skip​(long n)
        Specified by:
        skip in interface java.util.stream.IntStream
      • forEach

        public void forEach​(java.util.function.IntConsumer action)
        Specified by:
        forEach in interface java.util.stream.IntStream
      • forEachOrdered

        public void forEachOrdered​(java.util.function.IntConsumer action)
        Specified by:
        forEachOrdered in interface java.util.stream.IntStream
      • toArray

        public int[] toArray()
        Specified by:
        toArray in interface java.util.stream.IntStream
      • reduce

        public int reduce​(int identity,
                          java.util.function.IntBinaryOperator op)
        Specified by:
        reduce in interface java.util.stream.IntStream
      • reduce

        public java.util.OptionalInt reduce​(java.util.function.IntBinaryOperator op)
        Specified by:
        reduce in interface java.util.stream.IntStream
      • collect

        public <R> R collect​(java.util.function.Supplier<R> supplier,
                             java.util.function.ObjIntConsumer<R> accumulator,
                             java.util.function.BiConsumer<R,​R> combiner)
        Specified by:
        collect in interface java.util.stream.IntStream
      • sum

        public int sum()
        Specified by:
        sum in interface java.util.stream.IntStream
      • min

        public java.util.OptionalInt min()
        Specified by:
        min in interface java.util.stream.IntStream
      • max

        public java.util.OptionalInt max()
        Specified by:
        max in interface java.util.stream.IntStream
      • count

        public long count()
        Specified by:
        count in interface java.util.stream.IntStream
      • average

        public java.util.OptionalDouble average()
        Specified by:
        average in interface java.util.stream.IntStream
      • summaryStatistics

        public java.util.IntSummaryStatistics summaryStatistics()
        Specified by:
        summaryStatistics in interface java.util.stream.IntStream
      • anyMatch

        public boolean anyMatch​(java.util.function.IntPredicate predicate)
        Specified by:
        anyMatch in interface java.util.stream.IntStream
      • allMatch

        public boolean allMatch​(java.util.function.IntPredicate predicate)
        Specified by:
        allMatch in interface java.util.stream.IntStream
      • noneMatch

        public boolean noneMatch​(java.util.function.IntPredicate predicate)
        Specified by:
        noneMatch in interface java.util.stream.IntStream
      • findFirst

        public java.util.OptionalInt findFirst()
        Specified by:
        findFirst in interface java.util.stream.IntStream
      • findAny

        public java.util.OptionalInt findAny()
        Specified by:
        findAny in interface java.util.stream.IntStream
      • asLongStream

        public java.util.stream.LongStream asLongStream()
        Specified by:
        asLongStream in interface java.util.stream.IntStream
      • asDoubleStream

        public java.util.stream.DoubleStream asDoubleStream()
        Specified by:
        asDoubleStream in interface java.util.stream.IntStream
      • boxed

        public java.util.stream.Stream<java.lang.Integer> boxed()
        Specified by:
        boxed in interface java.util.stream.IntStream
      • sequential

        public java.util.stream.IntStream sequential()
        Specified by:
        sequential in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
        Specified by:
        sequential in interface java.util.stream.IntStream
      • parallel

        public java.util.stream.IntStream parallel()
        Specified by:
        parallel in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
        Specified by:
        parallel in interface java.util.stream.IntStream
      • unordered

        public java.util.stream.IntStream unordered()
        Specified by:
        unordered in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
      • onClose

        public java.util.stream.IntStream onClose​(java.lang.Runnable closeHandler)
        Specified by:
        onClose in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
      • iterator

        public java.util.PrimitiveIterator.OfInt iterator()
        Specified by:
        iterator in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
        Specified by:
        iterator in interface java.util.stream.IntStream
      • spliterator

        public java.util.Spliterator.OfInt spliterator()
        Specified by:
        spliterator in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>
        Specified by:
        spliterator in interface java.util.stream.IntStream
      • isParallel

        public boolean isParallel()
        Specified by:
        isParallel in interface java.util.stream.BaseStream<java.lang.Integer,​java.util.stream.IntStream>