Package com.google.common.collect
Class CollectSpliterators
- java.lang.Object
-
- com.google.common.collect.CollectSpliterators
-
@GwtCompatible final class CollectSpliterators extends java.lang.Object
Spliterator utilities forcommon.collect
internals.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
CollectSpliterators.FlatMapSpliterator<InElementT,OutElementT,OutSpliteratorT extends java.util.Spliterator<OutElementT>>
Implements theStream#flatMap
operation on spliterators.(package private) static class
CollectSpliterators.FlatMapSpliteratorOfDouble<InElementT>
(package private) static class
CollectSpliterators.FlatMapSpliteratorOfInt<InElementT>
(package private) static class
CollectSpliterators.FlatMapSpliteratorOfLong<InElementT>
(package private) static class
CollectSpliterators.FlatMapSpliteratorOfObject<InElementT,OutElementT>
Implementation ofStream#flatMap
with an object spliterator output type.(package private) static class
CollectSpliterators.FlatMapSpliteratorOfPrimitive<InElementT,OutElementT,OutConsumerT,OutSpliteratorT extends java.util.Spliterator.OfPrimitive<OutElementT,OutConsumerT,OutSpliteratorT>>
Implementation ofStream#flatMap
with a primitive spliterator output type.
-
Constructor Summary
Constructors Modifier Constructor Description private
CollectSpliterators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <T> java.util.Spliterator<T>
filter(java.util.Spliterator<T> fromSpliterator, java.util.function.Predicate<? super T> predicate)
Returns aSpliterator
filtered by the specified predicate.(package private) 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 aSpliterator
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
.(package private) static <InElementT>
java.util.Spliterator.OfDoubleflatMapToDouble(java.util.Spliterator<InElementT> fromSpliterator, java.util.function.Function<? super InElementT,java.util.Spliterator.OfDouble> function, int topCharacteristics, long topSize)
Returns aSpliterator.OfDouble
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
.(package private) static <InElementT>
java.util.Spliterator.OfIntflatMapToInt(java.util.Spliterator<InElementT> fromSpliterator, java.util.function.Function<? super InElementT,java.util.Spliterator.OfInt> function, int topCharacteristics, long topSize)
Returns aSpliterator.OfInt
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
.(package private) static <InElementT>
java.util.Spliterator.OfLongflatMapToLong(java.util.Spliterator<InElementT> fromSpliterator, java.util.function.Function<? super InElementT,java.util.Spliterator.OfLong> function, int topCharacteristics, long topSize)
Returns aSpliterator.OfLong
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
.(package private) static <T> java.util.Spliterator<T>
indexed(int size, int extraCharacteristics, java.util.function.IntFunction<T> function)
(package private) static <T> java.util.Spliterator<T>
indexed(int size, int extraCharacteristics, java.util.function.IntFunction<T> function, java.util.Comparator<? super T> comparator)
(package private) static <InElementT,OutElementT>
java.util.Spliterator<OutElementT>map(java.util.Spliterator<InElementT> fromSpliterator, java.util.function.Function<? super InElementT,? extends OutElementT> function)
Returns aSpliterator
over the elements offromSpliterator
mapped byfunction
.
-
-
-
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 aSpliterator
over the elements offromSpliterator
mapped byfunction
.
-
filter
static <T> java.util.Spliterator<T> filter(java.util.Spliterator<T> fromSpliterator, java.util.function.Predicate<? super T> predicate)
Returns aSpliterator
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 aSpliterator
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
.
-
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 aSpliterator.OfInt
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
. (Iffunction
returnsnull
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 aSpliterator.OfLong
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
. (Iffunction
returnsnull
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 aSpliterator.OfDouble
that iterates over the elements of the spliterators generated by applyingfunction
to the elements offromSpliterator
. (Iffunction
returnsnull
for an input, it is replaced with an empty stream.)
-
-