public final class EntryStream<K,V>
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
<R> R |
__(Function<? super EntryStream<K,V>,R> transfer) |
<K2,V2> EntryStream<K2,V2> |
chain(Function<? super Stream<java.util.Map.Entry<K,V>>,? extends Stream<java.util.Map.Entry<K2,V2>>> transfer) |
void |
close() |
Stream<java.util.List<V>> |
collapseByKey(BiPredicate<? super K,? super K> collapsible) |
Stream<java.util.Map.Entry<K,V>> |
collapseByKey(BiPredicate<? super K,? super K> collapsible,
BiFunction<? super java.util.Map.Entry<K,V>,? super java.util.Map.Entry<K,V>,java.util.Map.Entry<K,V>> mergeFunction) |
<R,A> Stream<R> |
collapseByKey(BiPredicate<? super K,? super K> collapsible,
Collector<? super java.util.Map.Entry<K,V>,A,R> collector)
Merge series of adjacent elements which satisfy the given predicate using
the merger function and return a new stream.
|
<R,A> R |
collect(Collector<? super java.util.Map.Entry<K,V>,A,R> collector) |
<R> R |
collect(Supplier<R> supplier,
BiConsumer<R,? super java.util.Map.Entry<K,V>> accumulator) |
<R> R |
collect(Supplier<R> supplier,
BiConsumer<R,? super java.util.Map.Entry<K,V>> accumulator,
BiConsumer<R,R> combiner) |
<R,A,RR> RR |
collectAndThen(Collector<? super java.util.Map.Entry<K,V>,A,R> downstream,
Function<R,RR> finisher) |
static <K,V> EntryStream<K,V> |
concat(java.util.Collection<? extends java.util.Map<K,V>> maps) |
static <K,V> EntryStream<K,V> |
concat(java.util.Map<K,V>... maps) |
long |
count() |
EntryStream<K,V> |
distinct() |
EntryStream<K,V> |
distinctBy(Function<? super java.util.Map.Entry<K,V>,?> keyExtractor) |
EntryStream<K,V> |
distinctByKey() |
EntryStream<K,V> |
distinctByValue() |
static <K,V> EntryStream<K,V> |
empty() |
Stream<java.util.Map.Entry<K,V>> |
entries() |
<KK> EntryStream<K,V> |
filter(BiPredicate<? super K,? super V> predicate) |
<KK> EntryStream<K,V> |
filter(Predicate<java.util.Map.Entry<K,V>> predicate) |
<KK> EntryStream<K,V> |
filterByKey(Predicate<? super K> keyPredicate) |
<KK> EntryStream<K,V> |
filterByValue(Predicate<? super V> valuePredicate) |
<KK,VV> EntryStream<KK,VV> |
flatMap(Function<? super java.util.Map.Entry<K,V>,Stream<java.util.Map.Entry<KK,VV>>> mapper) |
<KK> EntryStream<KK,V> |
flatMapKey(Function<? super K,Stream<KK>> keyMapper) |
<KK> EntryStream<KK,V> |
flatMapKeyER(Function<? super K,Stream<KK>> keyMapper) |
<VV> EntryStream<K,VV> |
flatMapValue(Function<? super V,Stream<VV>> valueMapper) |
<VV> EntryStream<K,VV> |
flatMapValueER(Function<? super V,Stream<VV>> valueMapper) |
void |
forEach(BiConsumer<? super K,? super V> action) |
void |
forEach(Consumer<? super java.util.Map.Entry<K,V>> action) |
EntryStream<K,java.util.List<V>> |
groupBy() |
EntryStream<K,V> |
groupBy(BinaryOperator<V> mergeFunction) |
EntryStream<K,V> |
groupBy(BinaryOperator<V> mergeFunction,
Supplier<java.util.Map<K,V>> mapFactory) |
<A,D> EntryStream<K,D> |
groupBy(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream) |
<A,D> EntryStream<K,D> |
groupBy(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream,
Supplier<java.util.Map<K,D>> mapFactory) |
<KK,A,D> EntryStream<KK,D> |
groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier,
Collector<? super java.util.Map.Entry<K,V>,A,D> downstream) |
<KK,A,D> EntryStream<KK,D> |
groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier,
Collector<? super java.util.Map.Entry<K,V>,A,D> downstream,
Supplier<java.util.Map<KK,D>> mapFactory) |
<KK,VV> EntryStream<KK,java.util.List<VV>> |
groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper) |
<KK,VV> EntryStream<KK,VV> |
groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
BinaryOperator<VV> mergeFunction) |
<KK,VV> EntryStream<KK,VV> |
groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
BinaryOperator<VV> mergeFunction,
Supplier<java.util.Map<KK,VV>> mapFactory) |
<KK,VV> EntryStream<KK,java.util.List<VV>> |
groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
Supplier<java.util.Map<KK,java.util.List<VV>>> mapFactory) |
EntryStream<K,java.util.List<V>> |
groupBy(Supplier<java.util.Map<K,java.util.List<V>>> mapFactory) |
java.util.Map<K,java.util.List<V>> |
groupTo() |
<KK,VV> java.util.Map<KK,java.util.List<VV>> |
groupTo(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper) |
<KK,VV,M extends java.util.Map<KK,java.util.List<VV>>> |
groupTo(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
Supplier<M> mapFactory) |
<M extends java.util.Map<K,java.util.List<V>>> |
groupTo(Supplier<M> mapFactory) |
<R> R |
groupToAndThen(Function<? super java.util.Map<K,java.util.List<V>>,R> func) |
EntryStream<V,K> |
inversed() |
EntryStream<V,K> |
inversedER() |
boolean |
isParallel() |
ObjIterator<java.util.Map.Entry<K,V>> |
iterator() |
Stream<K> |
keys() |
EntryStream<K,V> |
limit(long n) |
<KK,VV> EntryStream<KK,VV> |
map(BiFunction<? super K,? super V,java.util.Map.Entry<KK,VV>> mapper) |
<KK,VV> EntryStream<KK,VV> |
map(Function<? super K,KK> keyMapper,
Function<? super V,VV> valueMapper) |
<KK,VV> EntryStream<KK,VV> |
map(Function<? super java.util.Map.Entry<K,V>,java.util.Map.Entry<KK,VV>> mapper) |
<KK,VV> EntryStream<KK,VV> |
mapER(Function<? super K,KK> keyMapper,
Function<? super V,VV> valueMapper)
To reduce the memory footprint, Only one instance of
Map.Entry is created,
and the same entry instance is returned and set with different keys/values during iteration of the returned stream. |
<KK> EntryStream<KK,V> |
mapKey(Function<? super K,KK> keyMapper) |
<VV> EntryStream<K,VV> |
mapValue(Function<? super V,VV> valueMapper) |
static <K,V> EntryStream<K,V> |
of(java.util.Collection<? extends java.util.Map.Entry<K,V>> entries) |
static <K,T> EntryStream<K,T> |
of(java.util.Collection<? extends T> c,
Function<? super T,K> keyExtractor) |
static <K,V> EntryStream<K,V> |
of(java.util.Iterator<? extends java.util.Map.Entry<K,V>> iterator) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1,
K k2,
V v2) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6) |
static <K,V> EntryStream<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7) |
static <E> EntryStream<E,java.lang.Long> |
of(LongMultiset<E> multiset) |
static <K,V> EntryStream<K,V> |
of(java.util.Map<K,V> map) |
static <K,E,V extends java.util.Collection<E>> |
of(Multimap<K,E,V> mulitmap) |
static <E> EntryStream<E,java.lang.Integer> |
of(Multiset<E> multiset) |
static <K,V> EntryStream<K,V> |
of(Stream<? extends java.util.Map.Entry<K,V>> s) |
static <K,T> EntryStream<K,T> |
of(T[] a,
Function<? super T,K> keyExtractor) |
EntryStream<K,V> |
onClose(java.lang.Runnable closeHandler) |
EntryStream<K,V> |
parallel() |
EntryStream<K,V> |
parallel(int threadNum) |
EntryStream<K,V> |
peek(BiConsumer<? super K,? super V> action) |
EntryStream<K,V> |
peek(Consumer<? super java.util.Map.Entry<K,V>> action) |
Nullable<java.util.Map.Entry<K,V>> |
reduce(BinaryOperator<java.util.Map.Entry<K,V>> accumulator) |
java.util.Map.Entry<K,V> |
reduce(java.util.Map.Entry<K,V> identity,
BinaryOperator<java.util.Map.Entry<K,V>> accumulator) |
<U> U |
reduce(U identity,
BiFunction<U,? super java.util.Map.Entry<K,V>,U> accumulator) |
<U> U |
reduce(U identity,
BiFunction<U,? super java.util.Map.Entry<K,V>,U> accumulator,
BinaryOperator<U> combiner) |
EntryStream<K,V> |
reversed() |
EntryStream<K,V> |
rotated(int distance) |
EntryStream<K,V> |
sequential() |
EntryStream<K,V> |
shuffled() |
EntryStream<K,V> |
shuffled(java.util.Random rnd) |
EntryStream<K,V> |
skip(long n) |
EntryStream<K,V> |
sorted(java.util.Comparator<? super java.util.Map.Entry<K,V>> comparator) |
EntryStream<K,V> |
sortedBy(Function<? super java.util.Map.Entry<K,V>,? extends java.lang.Comparable> keyExtractor) |
EntryStream<K,V> |
sortedByKey(java.util.Comparator<? super K> keyComparator) |
EntryStream<K,V> |
sortedByValue(java.util.Comparator<? super V> valueComparator) |
ImmutableMap<K,V> |
toImmutableMap() |
ImmutableMap<K,V> |
toImmutableMap(BinaryOperator<V> mergeFunction) |
java.util.Map<K,V> |
toMap() |
java.util.Map<K,V> |
toMap(BinaryOperator<V> mergeFunction) |
<M extends java.util.Map<K,V>> |
toMap(BinaryOperator<V> mergeFunction,
Supplier<M> mapFactory) |
<A,D> java.util.Map<K,D> |
toMap(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream) |
<A,D,M extends java.util.Map<K,D>> |
toMap(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream,
Supplier<M> mapFactory) |
<KK,A,D> java.util.Map<KK,D> |
toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier,
Collector<? super java.util.Map.Entry<K,V>,A,D> downstream) |
<KK,A,D,M extends java.util.Map<KK,D>> |
toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier,
Collector<? super java.util.Map.Entry<K,V>,A,D> downstream,
Supplier<M> mapFactory) |
<KK,VV> java.util.Map<KK,VV> |
toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper) |
<KK,VV> java.util.Map<KK,VV> |
toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
BinaryOperator<VV> mergeFunction) |
<KK,VV,M extends java.util.Map<KK,VV>> |
toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
BinaryOperator<VV> mergeFunction,
Supplier<M> mapFactory) |
<KK,VV,M extends java.util.Map<KK,VV>> |
toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
Supplier<M> mapFactory) |
<M extends java.util.Map<K,V>> |
toMap(Supplier<M> mapFactory) |
<R> R |
toMapAndThen(Function<? super java.util.Map<K,V>,R> func) |
ListMultimap<K,V> |
toMultimap() |
<KK,VV> ListMultimap<KK,VV> |
toMultimap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper) |
<KK,VV,C extends java.util.Collection<VV>,M extends Multimap<KK,VV,C>> |
toMultimap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor,
Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper,
Supplier<M> mapFactory) |
<C extends java.util.Collection<V>,M extends Multimap<K,V,C>> |
toMultimap(Supplier<M> mapFactory) |
Stream<V> |
values() |
static <K,V> EntryStream<K,V> |
zip(java.util.Collection<? extends K> keys,
java.util.Collection<? extends V> values) |
static <K,V> EntryStream<K,V> |
zip(java.util.Collection<? extends K> keys,
java.util.Collection<? extends V> values,
K valueForNonKey,
V valueForNonValue) |
static <K,V> EntryStream<K,V> |
zip(K[] keys,
V[] values) |
static <K,V> EntryStream<K,V> |
zip(K[] keys,
V[] values,
K valueForNonKey,
V valueForNonValue) |
public static <K,V> EntryStream<K,V> empty()
public static <K,V> EntryStream<K,V> of(K k1, V v1)
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2)
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3)
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
public static <K,V> EntryStream<K,V> of(Stream<? extends java.util.Map.Entry<K,V>> s)
public static <K,V> EntryStream<K,V> of(java.util.Iterator<? extends java.util.Map.Entry<K,V>> iterator)
public static <K,V> EntryStream<K,V> of(java.util.Map<K,V> map)
public static <K,V> EntryStream<K,V> of(java.util.Collection<? extends java.util.Map.Entry<K,V>> entries)
public static <E> EntryStream<E,java.lang.Integer> of(Multiset<E> multiset)
public static <E> EntryStream<E,java.lang.Long> of(LongMultiset<E> multiset)
public static <K,E,V extends java.util.Collection<E>> EntryStream<K,V> of(Multimap<K,E,V> mulitmap)
public static <K,T> EntryStream<K,T> of(java.util.Collection<? extends T> c, Function<? super T,K> keyExtractor)
public static <K,T> EntryStream<K,T> of(T[] a, Function<? super T,K> keyExtractor)
@SafeVarargs public static <K,V> EntryStream<K,V> concat(java.util.Map<K,V>... maps)
public static <K,V> EntryStream<K,V> concat(java.util.Collection<? extends java.util.Map<K,V>> maps)
public static <K,V> EntryStream<K,V> zip(K[] keys, V[] values)
public static <K,V> EntryStream<K,V> zip(K[] keys, V[] values, K valueForNonKey, V valueForNonValue)
public static <K,V> EntryStream<K,V> zip(java.util.Collection<? extends K> keys, java.util.Collection<? extends V> values)
public static <K,V> EntryStream<K,V> zip(java.util.Collection<? extends K> keys, java.util.Collection<? extends V> values, K valueForNonKey, V valueForNonValue)
public EntryStream<V,K> inversed()
public <KK> EntryStream<K,V> filter(BiPredicate<? super K,? super V> predicate)
public <KK> EntryStream<K,V> filterByKey(Predicate<? super K> keyPredicate)
public <KK> EntryStream<K,V> filterByValue(Predicate<? super V> valuePredicate)
public <KK,VV> EntryStream<KK,VV> map(Function<? super java.util.Map.Entry<K,V>,java.util.Map.Entry<KK,VV>> mapper)
public <KK,VV> EntryStream<KK,VV> map(BiFunction<? super K,? super V,java.util.Map.Entry<KK,VV>> mapper)
public <KK,VV> EntryStream<KK,VV> map(Function<? super K,KK> keyMapper, Function<? super V,VV> valueMapper)
public <KK> EntryStream<KK,V> mapKey(Function<? super K,KK> keyMapper)
public <VV> EntryStream<K,VV> mapValue(Function<? super V,VV> valueMapper)
public <KK,VV> EntryStream<KK,VV> flatMap(Function<? super java.util.Map.Entry<K,V>,Stream<java.util.Map.Entry<KK,VV>>> mapper)
public <KK> EntryStream<KK,V> flatMapKey(Function<? super K,Stream<KK>> keyMapper)
public <VV> EntryStream<K,VV> flatMapValue(Function<? super V,Stream<VV>> valueMapper)
public EntryStream<K,java.util.List<V>> groupBy()
classifier
- Collectors.groupingBy(Function)
public EntryStream<K,java.util.List<V>> groupBy(Supplier<java.util.Map<K,java.util.List<V>>> mapFactory)
classifier
- mapFactory
- Collectors.groupingBy(Function, Supplier)
public <KK,VV> EntryStream<KK,java.util.List<VV>> groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper)
public <KK,VV> EntryStream<KK,java.util.List<VV>> groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, Supplier<java.util.Map<KK,java.util.List<VV>>> mapFactory)
keyExtractor
- valueMapper
- mapFactory
- Collectors.toMultimap(Function, Function, Supplier)
public <A,D> EntryStream<K,D> groupBy(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream)
downstream
- Collectors.groupingBy(Function, Collector)
public <A,D> EntryStream<K,D> groupBy(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream, Supplier<java.util.Map<K,D>> mapFactory)
downstream
- mapFactory
- Collectors.groupingBy(Function, Collector)
public <KK,A,D> EntryStream<KK,D> groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier, Collector<? super java.util.Map.Entry<K,V>,A,D> downstream)
classifier
- downstream
- mapFactory
- Collectors.groupingBy(Function, Collector, Supplier)
public <KK,A,D> EntryStream<KK,D> groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier, Collector<? super java.util.Map.Entry<K,V>,A,D> downstream, Supplier<java.util.Map<KK,D>> mapFactory)
classifier
- downstream
- Collectors.groupingBy(Function, Collector)
public EntryStream<K,V> groupBy(BinaryOperator<V> mergeFunction)
mergeFunction
- public EntryStream<K,V> groupBy(BinaryOperator<V> mergeFunction, Supplier<java.util.Map<K,V>> mapFactory)
mergeFunction
- mapFactory
- public <KK,VV> EntryStream<KK,VV> groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction)
keyExtractor
- valueMapper
- mergeFunction
- Collectors#groupBy(Function, Function, BinaryOperator)
public <KK,VV> EntryStream<KK,VV> groupBy(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction, Supplier<java.util.Map<KK,VV>> mapFactory)
keyExtractor
- valueMapper
- mergeFunction
- mapFactory
- Collectors#groupBy(Function, Function, BinaryOperator, Supplier)
public EntryStream<K,V> sorted(java.util.Comparator<? super java.util.Map.Entry<K,V>> comparator)
public EntryStream<K,V> sortedByKey(java.util.Comparator<? super K> keyComparator)
public EntryStream<K,V> sortedByValue(java.util.Comparator<? super V> valueComparator)
public EntryStream<K,V> sortedBy(Function<? super java.util.Map.Entry<K,V>,? extends java.lang.Comparable> keyExtractor)
public EntryStream<K,V> distinct()
public EntryStream<K,V> distinctByKey()
public EntryStream<K,V> distinctByValue()
public EntryStream<K,V> distinctBy(Function<? super java.util.Map.Entry<K,V>,?> keyExtractor)
public EntryStream<K,V> reversed()
public EntryStream<K,V> shuffled()
public EntryStream<K,V> shuffled(java.util.Random rnd)
public EntryStream<K,V> rotated(int distance)
public EntryStream<K,V> skip(long n)
public EntryStream<K,V> limit(long n)
public EntryStream<K,V> peek(BiConsumer<? super K,? super V> action)
public void forEach(BiConsumer<? super K,? super V> action)
public long count()
public ObjIterator<java.util.Map.Entry<K,V>> iterator()
public ImmutableMap<K,V> toImmutableMap()
public ImmutableMap<K,V> toImmutableMap(BinaryOperator<V> mergeFunction)
public java.util.Map<K,V> toMap(BinaryOperator<V> mergeFunction)
mergeFunction
- public <M extends java.util.Map<K,V>> M toMap(Supplier<M> mapFactory)
mapFactory
- public <M extends java.util.Map<K,V>> M toMap(BinaryOperator<V> mergeFunction, Supplier<M> mapFactory)
mergeFunction
- mapFactory
- public <KK,VV> java.util.Map<KK,VV> toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper)
keyExtractor
- valueMapper
- Collectors.toMap(Function, Function)
public <KK,VV,M extends java.util.Map<KK,VV>> M toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, Supplier<M> mapFactory)
keyExtractor
- valueMapper
- mapFactory
- Collectors.toMap(Function, Function, Supplier)
public <KK,VV> java.util.Map<KK,VV> toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction)
keyExtractor
- valueMapper
- mergeFunction
- Collectors.toMap(Function, Function, BinaryOperator)
public <KK,VV,M extends java.util.Map<KK,VV>> M toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction, Supplier<M> mapFactory)
keyExtractor
- valueMapper
- mergeFunction
- mapFactory
- Collectors.toMap(Function, Function, BinaryOperator, Supplier)
public <A,D> java.util.Map<K,D> toMap(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream)
downstream
- Collectors.groupingBy(Function, Collector)
public <A,D,M extends java.util.Map<K,D>> M toMap(Collector<? super java.util.Map.Entry<K,V>,A,D> downstream, Supplier<M> mapFactory)
downstream
- mapFactory
- Collectors.groupingBy(Function, Collector)
public <KK,A,D> java.util.Map<KK,D> toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier, Collector<? super java.util.Map.Entry<K,V>,A,D> downstream)
classifier
- downstream
- mapFactory
- Collectors.groupingBy(Function, Collector, Supplier)
public <KK,A,D,M extends java.util.Map<KK,D>> M toMap(Function<? super java.util.Map.Entry<K,V>,? extends KK> classifier, Collector<? super java.util.Map.Entry<K,V>,A,D> downstream, Supplier<M> mapFactory)
classifier
- downstream
- Collectors.groupingBy(Function, Collector)
public java.util.Map<K,java.util.List<V>> groupTo()
classifier
- Collectors.groupingBy(Function)
public <M extends java.util.Map<K,java.util.List<V>>> M groupTo(Supplier<M> mapFactory)
classifier
- mapFactory
- Collectors.groupingBy(Function, Supplier)
public <KK,VV> java.util.Map<KK,java.util.List<VV>> groupTo(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper)
public <KK,VV,M extends java.util.Map<KK,java.util.List<VV>>> M groupTo(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, Supplier<M> mapFactory)
keyExtractor
- valueMapper
- mapFactory
- Collectors.toMultimap(Function, Function, Supplier)
public <R> R groupToAndThen(Function<? super java.util.Map<K,java.util.List<V>>,R> func)
public ListMultimap<K,V> toMultimap()
keyExtractor
- Collectors.toMultimap(Function, Function)
public <C extends java.util.Collection<V>,M extends Multimap<K,V,C>> M toMultimap(Supplier<M> mapFactory)
keyExtractor
- mapFactory
- Collectors.toMultimap(Function, Function, Supplier)
public <KK,VV> ListMultimap<KK,VV> toMultimap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper)
keyExtractor
- valueMapper
- Collectors.toMultimap(Function, Function)
public <KK,VV,C extends java.util.Collection<VV>,M extends Multimap<KK,VV,C>> M toMultimap(Function<? super java.util.Map.Entry<K,V>,? extends KK> keyExtractor, Function<? super java.util.Map.Entry<K,V>,? extends VV> valueMapper, Supplier<M> mapFactory)
keyExtractor
- valueMapper
- mapFactory
- Collectors.toMultimap(Function, Function, Supplier)
public Stream<java.util.Map.Entry<K,V>> collapseByKey(BiPredicate<? super K,? super K> collapsible, BiFunction<? super java.util.Map.Entry<K,V>,? super java.util.Map.Entry<K,V>,java.util.Map.Entry<K,V>> mergeFunction)
collapsible
- mergeFunction
- Stream.collapse(BiPredicate, BiFunction)
public Stream<java.util.List<V>> collapseByKey(BiPredicate<? super K,? super K> collapsible)
collapsible
- Stream.collapse(BiPredicate, Collector)
public <R,A> Stream<R> collapseByKey(BiPredicate<? super K,? super K> collapsible, Collector<? super java.util.Map.Entry<K,V>,A,R> collector)
collapsible
- collector
- public java.util.Map.Entry<K,V> reduce(java.util.Map.Entry<K,V> identity, BinaryOperator<java.util.Map.Entry<K,V>> accumulator)
public Nullable<java.util.Map.Entry<K,V>> reduce(BinaryOperator<java.util.Map.Entry<K,V>> accumulator)
public <U> U reduce(U identity, BiFunction<U,? super java.util.Map.Entry<K,V>,U> accumulator, BinaryOperator<U> combiner)
public <U> U reduce(U identity, BiFunction<U,? super java.util.Map.Entry<K,V>,U> accumulator)
public <R> R collect(Supplier<R> supplier, BiConsumer<R,? super java.util.Map.Entry<K,V>> accumulator, BiConsumer<R,R> combiner)
public <R> R collect(Supplier<R> supplier, BiConsumer<R,? super java.util.Map.Entry<K,V>> accumulator)
public <R,A,RR> RR collectAndThen(Collector<? super java.util.Map.Entry<K,V>,A,R> downstream, Function<R,RR> finisher)
public <K2,V2> EntryStream<K2,V2> chain(Function<? super Stream<java.util.Map.Entry<K,V>>,? extends Stream<java.util.Map.Entry<K2,V2>>> transfer)
public <R> R __(Function<? super EntryStream<K,V>,R> transfer)
public EntryStream<K,V> sequential()
public EntryStream<K,V> parallel()
public EntryStream<K,V> parallel(int threadNum)
public boolean isParallel()
@Beta public <KK,VV> EntryStream<KK,VV> mapER(Function<? super K,KK> keyMapper, Function<? super V,VV> valueMapper)
Map.Entry
is created,
and the same entry instance is returned and set with different keys/values during iteration of the returned stream.
The elements only can be retrieved one by one, can't be modified or saved.
The returned Stream doesn't support the operations which require two or more elements at the same time: (e.g. sort/distinct/pairMap/slidingMap/sliding/split/toList/toSet/...).
, and can't be parallel stream.
Operations: filter/map/toMap/groupBy/groupTo/... are supported.
ER
= Entry Reusable
keyMapper
- valueMapper
- @Beta public <KK> EntryStream<KK,V> flatMapKeyER(Function<? super K,Stream<KK>> keyMapper)
keyMapper
- mapER(Function, Function)
@Beta public <VV> EntryStream<K,VV> flatMapValueER(Function<? super V,Stream<VV>> valueMapper)
valueMapper
- mapER(Function, Function)
@Beta public EntryStream<V,K> inversedER()
mapER(Function, Function)
public EntryStream<K,V> onClose(java.lang.Runnable closeHandler)
public void close()
close
in interface java.lang.AutoCloseable