Class CollectSpliterators


  • final class CollectSpliterators
    extends java.lang.Object
    Spliterator utilities for common.collect internals.
    • Constructor Detail

      • CollectSpliterators

        private CollectSpliterators()
    • Method Detail

      • indexed

        static <T> java.util.Spliterator<T> indexed​(int size,
                                                    int extraCharacteristics,
                                                    java.util.function.IntFunction<T> function)
      • indexed

        static <T> java.util.Spliterator<T> indexed​(int size,
                                                    int extraCharacteristics,
                                                    java.util.function.IntFunction<T> function,
                                                    java.util.Comparator<? super T> comparator)
      • map

        static <InElementT,​OutElementT> java.util.Spliterator<OutElementT> map​(java.util.Spliterator<InElementT> fromSpliterator,
                                                                                     java.util.function.Function<? super InElementT,​? extends OutElementT> function)
        Returns a Spliterator over the elements of fromSpliterator mapped by function.
      • filter

        static <T> java.util.Spliterator<T> filter​(java.util.Spliterator<T> fromSpliterator,
                                                   java.util.function.Predicate<? super T> predicate)
        Returns a Spliterator filtered by the specified predicate.
      • flatMap

        static <InElementT,​OutElementT> java.util.Spliterator<OutElementT> flatMap​(java.util.Spliterator<InElementT> fromSpliterator,
                                                                                         java.util.function.Function<? super InElementT,​java.util.Spliterator<OutElementT>> function,
                                                                                         int topCharacteristics,
                                                                                         long topSize)
        Returns a Spliterator that iterates over the elements of the spliterators generated by applying function to the elements of fromSpliterator.
      • flatMapToInt

        static <InElementT> java.util.Spliterator.OfInt flatMapToInt​(java.util.Spliterator<InElementT> fromSpliterator,
                                                                     java.util.function.Function<? super InElementT,​java.util.Spliterator.OfInt> function,
                                                                     int topCharacteristics,
                                                                     long topSize)
        Returns a Spliterator.OfInt that iterates over the elements of the spliterators generated by applying function to the elements of fromSpliterator. (If function returns null for an input, it is replaced with an empty stream.)
      • flatMapToLong

        static <InElementT> java.util.Spliterator.OfLong flatMapToLong​(java.util.Spliterator<InElementT> fromSpliterator,
                                                                       java.util.function.Function<? super InElementT,​java.util.Spliterator.OfLong> function,
                                                                       int topCharacteristics,
                                                                       long topSize)
        Returns a Spliterator.OfLong that iterates over the elements of the spliterators generated by applying function to the elements of fromSpliterator. (If function returns null for an input, it is replaced with an empty stream.)
      • flatMapToDouble

        static <InElementT> java.util.Spliterator.OfDouble flatMapToDouble​(java.util.Spliterator<InElementT> fromSpliterator,
                                                                           java.util.function.Function<? super InElementT,​java.util.Spliterator.OfDouble> function,
                                                                           int topCharacteristics,
                                                                           long topSize)
        Returns a Spliterator.OfDouble that iterates over the elements of the spliterators generated by applying function to the elements of fromSpliterator. (If function returns null for an input, it is replaced with an empty stream.)