Package com.landawn.abacus.util.stream
Class EntryStream<K,V>
- java.lang.Object
-
- com.landawn.abacus.util.stream.EntryStream<K,V>
-
- All Implemented Interfaces:
AutoCloseable
public final class EntryStream<K,V> extends Object implements AutoCloseable
The Stream will be automatically closed after execution(A terminal method is executed/triggered).- See Also:
BaseStream
,Stream
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <KK,VV>
EntryStream<KK,VV>__(Function<? super EntryStream<K,V>,EntryStream<KK,VV>> transfer)
<E extends Exception>
If.OrElseacceptIfNotEmpty(Throwables.Consumer<? super EntryStream<K,V>,E> action)
<E extends Exception>
booleanallMatch(Throwables.BiPredicate<? super K,? super V,E> predicate)
<E extends Exception>
booleanallMatch(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate)
<E extends Exception>
booleananyMatch(Throwables.BiPredicate<? super K,? super V,E> predicate)
<E extends Exception>
booleananyMatch(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate)
<M extends Map<? extends K,? extends V>>
EntryStream<K,V>append(M map)
EntryStream<K,V>
appendIfEmpty(Supplier<? extends EntryStream<K,V>> supplier)
<M extends Map<? extends K,? extends V>>
EntryStream<K,V>appendIfEmpty(M map)
<R,E extends Exception>
u.Optional<R>applyIfNotEmpty(Throwables.Function<? super EntryStream<K,V>,R,E> func)
<KK,VV>
EntryStream<KK,VV>chain(Function<? super Stream<Map.Entry<K,V>>,? extends Stream<Map.Entry<KK,VV>>> transfer)
void
close()
Stream<List<V>>
collapseByKey(BiPredicate<? super K,? super K> collapsible)
<R,A>
Stream<R>collapseByKey(BiPredicate<? super K,? super K> collapsible, Collector<? super V,A,R> collector)
Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.<R> R
collect(Supplier<R> supplier, BiConsumer<? super R,? super Map.Entry<K,V>> accumulator)
<R> R
collect(Supplier<R> supplier, BiConsumer<? super R,? super Map.Entry<K,V>> accumulator, BiConsumer<R,R> combiner)
<R,A>
Rcollect(Collector<? super Map.Entry<K,V>,A,R> collector)
<R,A>
Rcollect(Collector<? super Map.Entry<K,V>,A,R> collector)
<R,A,RR>
RRcollectAndThen(Collector<? super Map.Entry<K,V>,A,R> downstream, Function<? super R,RR> finisher)
<R,A,RR>
RRcollectAndThen(Collector<? super Map.Entry<K,V>,A,R> downstream, Function<? super R,RR> finisher)
static <K,V>
EntryStream<K,V>concat(Collection<? extends Map<K,V>> maps)
static <K,V>
EntryStream<K,V>concat(Map<K,V>... maps)
long
count()
EntryStream<K,V>
distinct()
EntryStream<K,V>
distinct(Predicate<? super Long> occurrencesFilter)
EntryStream<K,V>
distinctBy(Function<? super Map.Entry<K,V>,?> keyMapper)
EntryStream<K,V>
distinctBy(Function<? super Map.Entry<K,V>,?> keyMapper, BinaryOperator<Map.Entry<K,V>> mergeFunction)
EntryStream<K,V>
distinctBy(Function<? super Map.Entry<K,V>,?> keyMapper, Predicate<? super Long> occurrencesFilter)
EntryStream<K,V>
distinctByKey()
EntryStream<K,V>
distinctByValue()
<KK> EntryStream<K,V>
dropWhile(BiPredicate<? super K,? super V> predicate)
<KK> EntryStream<K,V>
dropWhile(Predicate<? super Map.Entry<K,V>> predicate)
static <K,V>
EntryStream<K,V>empty()
Stream<Map.Entry<K,V>>
entries()
<KK> EntryStream<K,V>
filter(BiPredicate<? super K,? super V> predicate)
<KK> EntryStream<K,V>
filter(Predicate<? super Map.Entry<K,V>> predicate)
<KK> EntryStream<K,V>
filterByKey(Predicate<? super K> keyPredicate)
<KK> EntryStream<K,V>
filterByValue(Predicate<? super V> valuePredicate)
<E extends Exception>
u.Optional<Map.Entry<K,V>>findAny(Throwables.BiPredicate<? super K,? super V,E> predicate)
<E extends Exception>
u.Optional<Map.Entry<K,V>>findAny(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate)
<E extends Exception>
u.Optional<Map.Entry<K,V>>findFirst(Throwables.BiPredicate<? super K,? super V,E> predicate)
<E extends Exception>
u.Optional<Map.Entry<K,V>>findFirst(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate)
u.Optional<Map.Entry<K,V>>
first()
<KK,VV>
EntryStream<KK,VV>flatMap(BiFunction<? super K,? super V,? extends EntryStream<? extends KK,? extends VV>> mapper)
<KK,VV>
EntryStream<KK,VV>flatMap(Function<? super Map.Entry<K,V>,? extends EntryStream<? extends KK,? extends VV>> mapper)
<KK> EntryStream<KK,V>
flatMapKey(BiFunction<? super K,? super V,? extends Stream<? extends KK>> keyMapper)
<KK> EntryStream<KK,V>
flatMapKey(Function<? super K,? extends Stream<? extends KK>> keyMapper)
<KK> EntryStream<KK,V>
flatMapKeyToDisposableEntry(Function<? super K,? extends Stream<? extends KK>> keyMapper)
Deprecated.<KK,VV>
EntryStream<KK,VV>flatMapp(BiFunction<? super K,? super V,? extends Map<? extends KK,? extends VV>> mapper)
<KK,VV>
EntryStream<KK,VV>flatMapp(Function<? super Map.Entry<K,V>,? extends Map<? extends KK,? extends VV>> mapper)
<VV> EntryStream<K,VV>
flatMapValue(BiFunction<? super K,? super V,? extends Stream<? extends VV>> valueMapper)
<VV> EntryStream<K,VV>
flatMapValue(Function<? super V,? extends Stream<? extends VV>> valueMapper)
<VV> EntryStream<K,VV>
flatMapValueToDisposableEntry(Function<? super V,? extends Stream<? extends VV>> valueMapper)
Deprecated.<KK,VV>
EntryStream<KK,VV>flattMap(BiFunction<? super K,? super V,? extends Stream<? extends Map.Entry<? extends KK,? extends VV>>> mapper)
<KK,VV>
EntryStream<KK,VV>flattMap(Function<? super Map.Entry<K,V>,? extends Stream<? extends Map.Entry<? extends KK,? extends VV>>> mapper)
<KK> EntryStream<KK,V>
flattMapKey(BiFunction<? super K,? super V,? extends Collection<? extends KK>> keyMapper)
<KK> EntryStream<KK,V>
flattMapKey(Function<? super K,? extends Collection<? extends KK>> keyMapper)
<KK> EntryStream<KK,V>
flattMapKeyToDisposableEntry(Function<? super K,? extends Collection<? extends KK>> keyMapper)
Deprecated.<VV> EntryStream<K,VV>
flattMapValue(BiFunction<? super K,? super V,? extends Collection<? extends VV>> valueMapper)
<VV> EntryStream<K,VV>
flattMapValue(Function<? super V,? extends Collection<? extends VV>> valueMapper)
<VV> EntryStream<K,VV>
flattMapValueToDisposableEntry(Function<? super V,? extends Collection<? extends VV>> valueMapper)
Deprecated.<E extends Exception>
voidforEach(Throwables.BiConsumer<? super K,? super V,E> action)
<E extends Exception>
voidforEach(Throwables.Consumer<? super Map.Entry<K,V>,E> action)
<E extends Exception>
voidforEachIndexed(Throwables.IndexedConsumer<? super Map.Entry<K,V>,E> action)
EntryStream<K,List<V>>
groupBy()
EntryStream<K,V>
groupBy(BinaryOperator<V> mergeFunction)
EntryStream<K,V>
groupBy(BinaryOperator<V> mergeFunction, Supplier<? extends Map<K,V>> mapFactory)
<KK,VV>
EntryStream<KK,List<VV>>groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
<KK,VV>
EntryStream<KK,VV>groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction)
<KK,VV>
EntryStream<KK,VV>groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction, Supplier<? extends Map<KK,VV>> mapFactory)
<KK,VV>
EntryStream<KK,List<VV>>groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends Map<KK,List<VV>>> mapFactory)
<KK,A,D>
EntryStream<KK,D>groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream)
<KK,A,D>
EntryStream<KK,D>groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends Map<KK,D>> mapFactory)
EntryStream<K,List<V>>
groupBy(Supplier<? extends Map<K,List<V>>> mapFactory)
<A,D>
EntryStream<K,D>groupBy(Collector<? super Map.Entry<K,V>,A,D> downstream)
<A,D>
EntryStream<K,D>groupBy(Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends Map<K,D>> mapFactory)
Map<K,List<V>>
groupTo()
<KK,VV>
Map<KK,List<VV>>groupTo(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
<KK,VV,M extends Map<KK,List<VV>>>
MgroupTo(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends M> mapFactory)
<M extends Map<K,List<V>>>
MgroupTo(Supplier<? extends M> mapFactory)
<R> R
groupToAndThen(Function<? super Map<K,List<V>>,R> func)
EntryStream<V,K>
inversed()
EntryStream<V,K>
inversedToDisposableEntry()
Deprecated.boolean
isParallel()
BiIterator<K,V>
iterator()
Remember to close this Stream after the iteration is done, if needed.String
join(CharSequence delimiter)
String
join(CharSequence delimiter, CharSequence keyValueDelimiter)
String
join(CharSequence delimiter, CharSequence prefix, CharSequence suffix)
String
join(CharSequence delimiter, CharSequence keyValueDelimiter, CharSequence prefix, CharSequence suffix)
Stream<K>
keys()
u.Optional<Map.Entry<K,V>>
last()
EntryStream<K,V>
limit(long maxSize)
<KK,VV>
EntryStream<KK,VV>map(BiFunction<? super K,? super V,? extends Map.Entry<? extends KK,? extends VV>> mapper)
<KK,VV>
EntryStream<KK,VV>map(BiFunction<? super K,? super V,? extends KK> keyMapper, BiFunction<? super K,? super V,? extends VV> valueMapper)
<KK,VV>
EntryStream<KK,VV>map(Function<? super Map.Entry<K,V>,? extends Map.Entry<? extends KK,? extends VV>> mapper)
<KK,VV>
EntryStream<KK,VV>map(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
<KK> EntryStream<KK,V>
mapKey(BiFunction<? super K,? super V,? extends KK> keyMapper)
<KK> EntryStream<KK,V>
mapKey(Function<? super K,? extends KK> keyMapper)
<KK,VV>
EntryStream<KK,VV>mapToDisposableEntry(BiFunction<? super K,? super V,? extends KK> keyMapper, BiFunction<? super K,? super V,? extends VV> valueMapper)
Deprecated.<KK,VV>
EntryStream<KK,VV>mapToDisposableEntry(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
Deprecated.<VV> EntryStream<K,VV>
mapValue(BiFunction<? super K,? super V,? extends VV> keyMapper)
<VV> EntryStream<K,VV>
mapValue(Function<? super V,? extends VV> valueMapper)
u.Optional<Map.Entry<K,V>>
max(Comparator<? super Map.Entry<K,V>> comparator)
u.Optional<Map.Entry<K,V>>
maxBy(Function<? super Map.Entry<K,V>,? extends Comparable> keyMapper)
u.Optional<Map.Entry<K,V>>
maxByKey(Comparator<? super K> keyComparator)
u.Optional<Map.Entry<K,V>>
maxByValue(Comparator<? super V> valueComparator)
static <K,V>
EntryStream<K,V>merge(Collection<? extends Map<K,V>> maps, BiFunction<? super Map.Entry<K,V>,? super Map.Entry<K,V>,MergeResult> nextSelector)
static <K,V>
EntryStream<K,V>merge(Map<K,V> a, Map<K,V> b, BiFunction<? super Map.Entry<K,V>,? super Map.Entry<K,V>,MergeResult> nextSelector)
static <K,V>
EntryStream<K,V>merge(Map<K,V> a, Map<K,V> b, Map<K,V> c, BiFunction<? super Map.Entry<K,V>,? super Map.Entry<K,V>,MergeResult> nextSelector)
u.Optional<Map.Entry<K,V>>
min(Comparator<? super Map.Entry<K,V>> comparator)
u.Optional<Map.Entry<K,V>>
minBy(Function<? super Map.Entry<K,V>,? extends Comparable> keyMapper)
u.Optional<Map.Entry<K,V>>
minByKey(Comparator<? super K> keyComparator)
u.Optional<Map.Entry<K,V>>
minByValue(Comparator<? super V> valueComparator)
<E extends Exception>
booleannoneMatch(Throwables.BiPredicate<? super K,? super V,E> predicate)
<E extends Exception>
booleannoneMatch(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate)
static <E> EntryStream<E,Long>
of(LongMultiset<E> multiset)
static <K,E,V extends Collection<E>>
EntryStream<K,V>of(Multimap<K,E,V> mulitmap)
static <E> EntryStream<E,Integer>
of(Multiset<E> multiset)
static <K,V>
EntryStream<K,V>of(Collection<? extends Map.Entry<? extends K,? extends V>> entries)
static <K,T>
EntryStream<K,T>of(Collection<? extends T> c, Function<? super T,K> keyMapper)
static <K,V>
EntryStream<K,V>of(Iterator<? extends Map.Entry<? extends K,? extends V>> iterator)
static <K,T>
EntryStream<K,T>of(Iterator<? extends T> iter, Function<? super T,K> keyMapper)
static <K,V>
EntryStream<K,V>of(Map<K,V> map)
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 <K,T>
EntryStream<K,T>of(T[] a, Function<? super T,K> keyMapper)
static <K,V>
EntryStream<K,V>ofNullable(Map.Entry<K,V> entry)
EntryStream<K,V>
onClose(Runnable closeHandler)
EntryStream<K,V>
parallel()
EntryStream<K,V>
parallel(int threadNum)
EntryStream<K,V>
parallel(int maxThreadNum, BaseStream.Splitor splitor)
EntryStream<K,V>
parallel(int maxThreadNum, BaseStream.Splitor splitor, Executor executor)
EntryStream<K,V>
parallel(int maxThreadNum, Executor executor)
EntryStream<K,V>
parallel(Executor executor)
EntryStream<K,V>
peek(BiConsumer<? super K,? super V> action)
EntryStream<K,V>
peek(Consumer<? super Map.Entry<K,V>> action)
<M extends Map<? extends K,? extends V>>
EntryStream<K,V>prepend(M map)
u.Optional<Map.Entry<K,V>>
reduce(BinaryOperator<Map.Entry<K,V>> accumulator)
Map.Entry<K,V>
reduce(Map.Entry<K,V> identity, BinaryOperator<Map.Entry<K,V>> accumulator)
<KK> EntryStream<K,V>
removeIf(BiPredicate<? super K,? super V> predicate)
Deprecated.<KK> EntryStream<K,V>
removeIf(Predicate<? super Map.Entry<K,V>> predicate)
Deprecated.EntryStream<K,V>
reversed()
EntryStream<K,V>
rotated(int distance)
<KK> EntryStream<KK,V>
selectByKey(Class<KK> clazz)
Returns a stream consisting of the elements of this stream which keys are instances of given class.<VV> EntryStream<K,VV>
selectByValue(Class<VV> clazz)
Returns a stream consisting of the elements of this stream which values are instances of given class.EntryStream<K,V>
sequential()
EntryStream<K,V>
shuffled()
EntryStream<K,V>
shuffled(Random rnd)
EntryStream<K,V>
skip(long n)
<KK> EntryStream<K,V>
skipUntil(BiPredicate<? super K,? super V> predicate)
<KK> EntryStream<K,V>
skipUntil(Predicate<? super Map.Entry<K,V>> predicate)
EntryStream<K,V>
sorted(Comparator<? super Map.Entry<K,V>> comparator)
EntryStream<K,V>
sortedBy(Function<? super Map.Entry<K,V>,? extends Comparable> keyMapper)
EntryStream<K,V>
sortedByDouble(ToDoubleFunction<? super Map.Entry<K,V>> keyMapper)
EntryStream<K,V>
sortedByInt(ToIntFunction<? super Map.Entry<K,V>> keyMapper)
EntryStream<K,V>
sortedByKey(Comparator<? super K> keyComparator)
EntryStream<K,V>
sortedByLong(ToLongFunction<? super Map.Entry<K,V>> keyMapper)
EntryStream<K,V>
sortedByValue(Comparator<? super V> valueComparator)
<KK> EntryStream<K,V>
takeWhile(BiPredicate<? super K,? super V> predicate)
<KK> EntryStream<K,V>
takeWhile(Predicate<? super Map.Entry<K,V>> predicate)
<T,CC extends Collection<T>>
CCtoCollection(BiFunction<? super K,? super V,? extends T> mapper, Supplier<? extends CC> supplier)
<T,CC extends Collection<T>>
CCtoCollection(Function<? super Map.Entry<K,V>,? extends T> mapper, Supplier<? extends CC> supplier)
ImmutableMap<K,V>
toImmutableMap()
ImmutableMap<K,V>
toImmutableMap(BinaryOperator<V> mergeFunction)
<T> List<T>
toList(BiFunction<? super K,? super V,? extends T> mapper)
<T> List<T>
toList(Function<? super Map.Entry<K,V>,? extends T> mapper)
Map<K,V>
toMap()
Map<K,V>
toMap(BinaryOperator<V> mergeFunction)
<M extends Map<K,V>>
MtoMap(BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
<KK,VV>
Map<KK,VV>toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
<KK,VV>
Map<KK,VV>toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction)
<KK,VV,M extends Map<KK,VV>>
MtoMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction, Supplier<? extends M> mapFactory)
<KK,VV,M extends Map<KK,VV>>
MtoMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends M> mapFactory)
<KK,A,D>
Map<KK,D>toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream)
<KK,A,D,M extends Map<KK,D>>
MtoMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends M> mapFactory)
<M extends Map<K,V>>
MtoMap(Supplier<? extends M> mapFactory)
<A,D>
Map<K,D>toMap(Collector<? super Map.Entry<K,V>,A,D> downstream)
<A,D,M extends Map<K,D>>
MtoMap(Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends M> mapFactory)
<R> R
toMapAndThen(Function<? super Map<K,V>,R> func)
ListMultimap<K,V>
toMultimap()
<KK,VV>
ListMultimap<KK,VV>toMultimap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
<KK,VV,C extends Collection<VV>,M extends Multimap<KK,VV,C>>
MtoMultimap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends M> mapFactory)
<C extends Collection<V>,M extends Multimap<K,V,C>>
MtoMultimap(Supplier<? extends M> mapFactory)
<T> Set<T>
toSet(BiFunction<? super K,? super V,? extends T> mapper)
<T> Set<T>
toSet(Function<? super Map.Entry<K,V>,? extends T> mapper)
Stream<V>
values()
static <K,V>
EntryStream<K,V>zip(Collection<? extends K> keys, Collection<? extends V> values)
static <K,V>
EntryStream<K,V>zip(Collection<? extends K> keys, 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)
-
-
-
Method Detail
-
inversed
@ParallelSupported public EntryStream<V,K> inversed()
-
selectByKey
@SequentialOnly public <KK> EntryStream<KK,V> selectByKey(Class<KK> clazz)
Returns a stream consisting of the elements of this stream which keys are instances of given class.This is an intermediate operation.
- Type Parameters:
KK
- a type of keys to select.- Parameters:
clazz
- a class to filter the keys.- Returns:
-
selectByValue
@SequentialOnly public <VV> EntryStream<K,VV> selectByValue(Class<VV> clazz)
Returns a stream consisting of the elements of this stream which values are instances of given class.This is an intermediate operation.
- Type Parameters:
VV
- a type of values to select.- Parameters:
clazz
- a class to filter the values.- Returns:
-
filter
@ParallelSupported public <KK> EntryStream<K,V> filter(Predicate<? super Map.Entry<K,V>> predicate)
-
filter
@ParallelSupported public <KK> EntryStream<K,V> filter(BiPredicate<? super K,? super V> predicate)
-
filterByKey
@ParallelSupported public <KK> EntryStream<K,V> filterByKey(Predicate<? super K> keyPredicate)
-
filterByValue
@ParallelSupported public <KK> EntryStream<K,V> filterByValue(Predicate<? super V> valuePredicate)
-
removeIf
@Deprecated @ParallelSupported public <KK> EntryStream<K,V> removeIf(Predicate<? super Map.Entry<K,V>> predicate)
Deprecated.- Type Parameters:
KK
-- Parameters:
predicate
-- Returns:
-
removeIf
@Deprecated @ParallelSupported public <KK> EntryStream<K,V> removeIf(BiPredicate<? super K,? super V> predicate)
Deprecated.- Type Parameters:
KK
-- Parameters:
predicate
-- Returns:
-
takeWhile
@ParallelSupported public <KK> EntryStream<K,V> takeWhile(Predicate<? super Map.Entry<K,V>> predicate)
-
takeWhile
@ParallelSupported public <KK> EntryStream<K,V> takeWhile(BiPredicate<? super K,? super V> predicate)
-
dropWhile
@ParallelSupported public <KK> EntryStream<K,V> dropWhile(Predicate<? super Map.Entry<K,V>> predicate)
-
dropWhile
@ParallelSupported public <KK> EntryStream<K,V> dropWhile(BiPredicate<? super K,? super V> predicate)
-
skipUntil
@ParallelSupported public <KK> EntryStream<K,V> skipUntil(Predicate<? super Map.Entry<K,V>> predicate)
-
skipUntil
@ParallelSupported public <KK> EntryStream<K,V> skipUntil(BiPredicate<? super K,? super V> predicate)
-
map
@ParallelSupported public <KK,VV> EntryStream<KK,VV> map(Function<? super Map.Entry<K,V>,? extends Map.Entry<? extends KK,? extends VV>> mapper)
-
map
@ParallelSupported public <KK,VV> EntryStream<KK,VV> map(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
-
map
@ParallelSupported public <KK,VV> EntryStream<KK,VV> map(BiFunction<? super K,? super V,? extends Map.Entry<? extends KK,? extends VV>> mapper)
-
map
@ParallelSupported public <KK,VV> EntryStream<KK,VV> map(BiFunction<? super K,? super V,? extends KK> keyMapper, BiFunction<? super K,? super V,? extends VV> valueMapper)
-
mapKey
@ParallelSupported public <KK> EntryStream<KK,V> mapKey(Function<? super K,? extends KK> keyMapper)
-
mapKey
@ParallelSupported public <KK> EntryStream<KK,V> mapKey(BiFunction<? super K,? super V,? extends KK> keyMapper)
-
mapValue
@ParallelSupported public <VV> EntryStream<K,VV> mapValue(Function<? super V,? extends VV> valueMapper)
-
mapValue
@ParallelSupported public <VV> EntryStream<K,VV> mapValue(BiFunction<? super K,? super V,? extends VV> keyMapper)
-
flatMap
@ParallelSupported public <KK,VV> EntryStream<KK,VV> flatMap(Function<? super Map.Entry<K,V>,? extends EntryStream<? extends KK,? extends VV>> mapper)
-
flatMap
@ParallelSupported public <KK,VV> EntryStream<KK,VV> flatMap(BiFunction<? super K,? super V,? extends EntryStream<? extends KK,? extends VV>> mapper)
-
flattMap
@ParallelSupported public <KK,VV> EntryStream<KK,VV> flattMap(Function<? super Map.Entry<K,V>,? extends Stream<? extends Map.Entry<? extends KK,? extends VV>>> mapper)
-
flattMap
@ParallelSupported public <KK,VV> EntryStream<KK,VV> flattMap(BiFunction<? super K,? super V,? extends Stream<? extends Map.Entry<? extends KK,? extends VV>>> mapper)
-
flatMapp
@ParallelSupported public <KK,VV> EntryStream<KK,VV> flatMapp(Function<? super Map.Entry<K,V>,? extends Map<? extends KK,? extends VV>> mapper)
-
flatMapp
@ParallelSupported public <KK,VV> EntryStream<KK,VV> flatMapp(BiFunction<? super K,? super V,? extends Map<? extends KK,? extends VV>> mapper)
-
flatMapKey
@ParallelSupported public <KK> EntryStream<KK,V> flatMapKey(Function<? super K,? extends Stream<? extends KK>> keyMapper)
-
flatMapKey
@ParallelSupported public <KK> EntryStream<KK,V> flatMapKey(BiFunction<? super K,? super V,? extends Stream<? extends KK>> keyMapper)
-
flattMapKey
@ParallelSupported public <KK> EntryStream<KK,V> flattMapKey(Function<? super K,? extends Collection<? extends KK>> keyMapper)
-
flattMapKey
@ParallelSupported public <KK> EntryStream<KK,V> flattMapKey(BiFunction<? super K,? super V,? extends Collection<? extends KK>> keyMapper)
-
flatMapValue
@ParallelSupported public <VV> EntryStream<K,VV> flatMapValue(Function<? super V,? extends Stream<? extends VV>> valueMapper)
-
flatMapValue
@ParallelSupported public <VV> EntryStream<K,VV> flatMapValue(BiFunction<? super K,? super V,? extends Stream<? extends VV>> valueMapper)
-
flattMapValue
@ParallelSupported public <VV> EntryStream<K,VV> flattMapValue(Function<? super V,? extends Collection<? extends VV>> valueMapper)
-
flattMapValue
@ParallelSupported public <VV> EntryStream<K,VV> flattMapValue(BiFunction<? super K,? super V,? extends Collection<? extends VV>> valueMapper)
-
groupBy
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,List<V>> groupBy()
- Parameters:
keyMapper
-- Returns:
- See Also:
Collectors.groupingBy(Function)
-
groupBy
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,List<V>> groupBy(Supplier<? extends Map<K,List<V>>> mapFactory)
- Parameters:
keyMapper
-mapFactory
-- Returns:
- See Also:
Collectors.groupingBy(Function, Supplier)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <KK,VV> EntryStream<KK,List<VV>> groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <KK,VV> EntryStream<KK,List<VV>> groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends Map<KK,List<VV>>> mapFactory)
- Parameters:
keyMapper
-valueMapper
-mapFactory
-- Returns:
- See Also:
Collectors.toMultimap(Function, Function, Supplier)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <A,D> EntryStream<K,D> groupBy(Collector<? super Map.Entry<K,V>,A,D> downstream)
- Parameters:
downstream
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <A,D> EntryStream<K,D> groupBy(Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends Map<K,D>> mapFactory)
- Parameters:
downstream
-mapFactory
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <KK,A,D> EntryStream<KK,D> groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream)
- Parameters:
keyMapper
-downstream
-mapFactory
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector, Supplier)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <KK,A,D> EntryStream<KK,D> groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends Map<KK,D>> mapFactory)
- Parameters:
keyMapper
-downstream
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector)
-
groupBy
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> groupBy(BinaryOperator<V> mergeFunction)
- Parameters:
mergeFunction
-- Returns:
-
groupBy
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> groupBy(BinaryOperator<V> mergeFunction, Supplier<? extends Map<K,V>> mapFactory)
- Parameters:
mergeFunction
-mapFactory
-- Returns:
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <KK,VV> EntryStream<KK,VV> groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction)
- Parameters:
keyMapper
-valueMapper
-mergeFunction
-- Returns:
- See Also:
Collectors#groupBy(Function, Function, BinaryOperator)
-
groupBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public <KK,VV> EntryStream<KK,VV> groupBy(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction, Supplier<? extends Map<KK,VV>> mapFactory)
- Parameters:
keyMapper
-valueMapper
-mergeFunction
-mapFactory
-- Returns:
- See Also:
Collectors#groupBy(Function, Function, BinaryOperator, Supplier)
-
collapseByKey
@SequentialOnly public Stream<List<V>> collapseByKey(BiPredicate<? super K,? super K> collapsible)
- Parameters:
collapsible
-- Returns:
- See Also:
Stream.collapse(BiPredicate, Collector)
-
collapseByKey
@SequentialOnly public <R,A> Stream<R> collapseByKey(BiPredicate<? super K,? super K> collapsible, Collector<? super V,A,R> collector)
Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.
This method only run sequentially, even in parallel stream.- Parameters:
collapsible
-collector
-- Returns:
-
sorted
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sorted(Comparator<? super Map.Entry<K,V>> comparator)
-
sortedByKey
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sortedByKey(Comparator<? super K> keyComparator)
-
sortedByValue
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sortedByValue(Comparator<? super V> valueComparator)
-
sortedBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sortedBy(Function<? super Map.Entry<K,V>,? extends Comparable> keyMapper)
-
sortedByInt
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sortedByInt(ToIntFunction<? super Map.Entry<K,V>> keyMapper)
- Parameters:
keyMapper
-- Returns:
-
sortedByLong
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sortedByLong(ToLongFunction<? super Map.Entry<K,V>> keyMapper)
- Parameters:
keyMapper
-- Returns:
-
sortedByDouble
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> sortedByDouble(ToDoubleFunction<? super Map.Entry<K,V>> keyMapper)
- Parameters:
keyMapper
-- Returns:
-
distinct
@SequentialOnly @IntermediateOp public EntryStream<K,V> distinct()
-
distinctByKey
@SequentialOnly @IntermediateOp public EntryStream<K,V> distinctByKey()
-
distinctByValue
@SequentialOnly @IntermediateOp public EntryStream<K,V> distinctByValue()
-
distinctBy
@ParallelSupported @IntermediateOp public EntryStream<K,V> distinctBy(Function<? super Map.Entry<K,V>,?> keyMapper)
-
distinct
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> distinct(Predicate<? super Long> occurrencesFilter)
-
distinctBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> distinctBy(Function<? super Map.Entry<K,V>,?> keyMapper, Predicate<? super Long> occurrencesFilter)
- Parameters:
keyMapper
-occurrencesFilter
-- Returns:
- See Also:
groupBy(Function, Collector)
-
distinctBy
@ParallelSupported @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> distinctBy(Function<? super Map.Entry<K,V>,?> keyMapper, BinaryOperator<Map.Entry<K,V>> mergeFunction)
- Parameters:
keyMapper
-mergeFunction
-- Returns:
- See Also:
groupBy(Function, Function, BinaryOperator)
-
reversed
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> reversed()
-
rotated
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> rotated(int distance)
-
shuffled
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> shuffled()
-
shuffled
@SequentialOnly @IntermediateOp @TerminalOpTriggered public EntryStream<K,V> shuffled(Random rnd)
-
prepend
@SequentialOnly public <M extends Map<? extends K,? extends V>> EntryStream<K,V> prepend(M map)
-
append
@SequentialOnly public <M extends Map<? extends K,? extends V>> EntryStream<K,V> append(M map)
-
appendIfEmpty
@SequentialOnly public <M extends Map<? extends K,? extends V>> EntryStream<K,V> appendIfEmpty(M map)
-
appendIfEmpty
public EntryStream<K,V> appendIfEmpty(Supplier<? extends EntryStream<K,V>> supplier)
-
applyIfNotEmpty
public <R,E extends Exception> u.Optional<R> applyIfNotEmpty(Throwables.Function<? super EntryStream<K,V>,R,E> func) throws E extends Exception
- Throws:
E extends Exception
-
acceptIfNotEmpty
public <E extends Exception> If.OrElse acceptIfNotEmpty(Throwables.Consumer<? super EntryStream<K,V>,E> action) throws E extends Exception
- Throws:
E extends Exception
-
skip
@SequentialOnly public EntryStream<K,V> skip(long n)
-
limit
@SequentialOnly public EntryStream<K,V> limit(long maxSize)
-
peek
@ParallelSupported public EntryStream<K,V> peek(Consumer<? super Map.Entry<K,V>> action)
-
peek
@ParallelSupported public EntryStream<K,V> peek(BiConsumer<? super K,? super V> action)
-
forEach
@ParallelSupported public <E extends Exception> void forEach(Throwables.Consumer<? super Map.Entry<K,V>,E> action) throws E extends Exception
- Throws:
E extends Exception
-
forEach
@ParallelSupported public <E extends Exception> void forEach(Throwables.BiConsumer<? super K,? super V,E> action) throws E extends Exception
- Throws:
E extends Exception
-
forEachIndexed
@ParallelSupported public <E extends Exception> void forEachIndexed(Throwables.IndexedConsumer<? super Map.Entry<K,V>,E> action) throws E extends Exception
- Throws:
E extends Exception
-
min
@ParallelSupported public u.Optional<Map.Entry<K,V>> min(Comparator<? super Map.Entry<K,V>> comparator)
-
minByKey
@ParallelSupported public u.Optional<Map.Entry<K,V>> minByKey(Comparator<? super K> keyComparator)
-
minByValue
@ParallelSupported public u.Optional<Map.Entry<K,V>> minByValue(Comparator<? super V> valueComparator)
-
minBy
@ParallelSupported public u.Optional<Map.Entry<K,V>> minBy(Function<? super Map.Entry<K,V>,? extends Comparable> keyMapper)
-
max
@ParallelSupported public u.Optional<Map.Entry<K,V>> max(Comparator<? super Map.Entry<K,V>> comparator)
-
maxByKey
@ParallelSupported public u.Optional<Map.Entry<K,V>> maxByKey(Comparator<? super K> keyComparator)
-
maxByValue
@ParallelSupported public u.Optional<Map.Entry<K,V>> maxByValue(Comparator<? super V> valueComparator)
-
maxBy
@ParallelSupported public u.Optional<Map.Entry<K,V>> maxBy(Function<? super Map.Entry<K,V>,? extends Comparable> keyMapper)
-
anyMatch
@ParallelSupported public <E extends Exception> boolean anyMatch(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
anyMatch
@ParallelSupported public <E extends Exception> boolean anyMatch(Throwables.BiPredicate<? super K,? super V,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
allMatch
@ParallelSupported public <E extends Exception> boolean allMatch(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
allMatch
@ParallelSupported public <E extends Exception> boolean allMatch(Throwables.BiPredicate<? super K,? super V,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
noneMatch
@ParallelSupported public <E extends Exception> boolean noneMatch(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
noneMatch
@ParallelSupported public <E extends Exception> boolean noneMatch(Throwables.BiPredicate<? super K,? super V,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
findFirst
@ParallelSupported public <E extends Exception> u.Optional<Map.Entry<K,V>> findFirst(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
findFirst
@ParallelSupported public <E extends Exception> u.Optional<Map.Entry<K,V>> findFirst(Throwables.BiPredicate<? super K,? super V,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
findAny
@ParallelSupported public <E extends Exception> u.Optional<Map.Entry<K,V>> findAny(Throwables.Predicate<? super Map.Entry<K,V>,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
findAny
@ParallelSupported public <E extends Exception> u.Optional<Map.Entry<K,V>> findAny(Throwables.BiPredicate<? super K,? super V,E> predicate) throws E extends Exception
- Throws:
E extends Exception
-
first
@SequentialOnly public u.Optional<Map.Entry<K,V>> first()
-
last
@SequentialOnly public u.Optional<Map.Entry<K,V>> last()
-
count
@SequentialOnly public long count()
-
iterator
@SequentialOnly public BiIterator<K,V> iterator()
Remember to close this Stream after the iteration is done, if needed.- Returns:
-
toList
public <T> List<T> toList(BiFunction<? super K,? super V,? extends T> mapper)
-
toSet
public <T> Set<T> toSet(BiFunction<? super K,? super V,? extends T> mapper)
-
toCollection
public <T,CC extends Collection<T>> CC toCollection(Function<? super Map.Entry<K,V>,? extends T> mapper, Supplier<? extends CC> supplier)
-
toCollection
public <T,CC extends Collection<T>> CC toCollection(BiFunction<? super K,? super V,? extends T> mapper, Supplier<? extends CC> supplier)
-
toImmutableMap
@ParallelSupported public ImmutableMap<K,V> toImmutableMap()
- Returns:
-
toImmutableMap
@ParallelSupported public ImmutableMap<K,V> toImmutableMap(BinaryOperator<V> mergeFunction)
- Returns:
-
toMap
@SequentialOnly public Map<K,V> toMap()
- Returns:
-
toMap
@SequentialOnly public Map<K,V> toMap(BinaryOperator<V> mergeFunction)
- Parameters:
mergeFunction
-- Returns:
-
toMap
@SequentialOnly public <M extends Map<K,V>> M toMap(Supplier<? extends M> mapFactory)
- Parameters:
mapFactory
-- Returns:
-
toMap
@SequentialOnly public <M extends Map<K,V>> M toMap(BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
- Parameters:
mergeFunction
-mapFactory
-- Returns:
-
toMap
@ParallelSupported public <KK,VV> Map<KK,VV> toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
- Parameters:
keyMapper
-valueMapper
-- Returns:
- See Also:
Collectors.toMap(Function, Function)
-
toMap
@ParallelSupported public <KK,VV,M extends Map<KK,VV>> M toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-valueMapper
-mapFactory
-- Returns:
- See Also:
Collectors.toMap(Function, Function, Supplier)
-
toMap
@ParallelSupported public <KK,VV> Map<KK,VV> toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction)
- Parameters:
keyMapper
-valueMapper
-mergeFunction
-- Returns:
- See Also:
Collectors.toMap(Function, Function, BinaryOperator)
-
toMap
@ParallelSupported public <KK,VV,M extends Map<KK,VV>> M toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, BinaryOperator<VV> mergeFunction, Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-valueMapper
-mergeFunction
-mapFactory
-- Returns:
- See Also:
Collectors.toMap(Function, Function, BinaryOperator, Supplier)
-
toMap
@ParallelSupported public <A,D> Map<K,D> toMap(Collector<? super Map.Entry<K,V>,A,D> downstream)
- Parameters:
downstream
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector)
-
toMap
@ParallelSupported public <A,D,M extends Map<K,D>> M toMap(Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends M> mapFactory)
- Parameters:
downstream
-mapFactory
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector)
-
toMap
@ParallelSupported public <KK,A,D> Map<KK,D> toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream)
- Parameters:
keyMapper
-downstream
-mapFactory
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector, Supplier)
-
toMap
@ParallelSupported public <KK,A,D,M extends Map<KK,D>> M toMap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Collector<? super Map.Entry<K,V>,A,D> downstream, Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-downstream
-- Returns:
- See Also:
Collectors.groupingBy(Function, Collector)
-
toMapAndThen
@SequentialOnly public <R> R toMapAndThen(Function<? super Map<K,V>,R> func)
-
groupTo
@SequentialOnly public Map<K,List<V>> groupTo()
- Parameters:
keyMapper
-- Returns:
- See Also:
Collectors.groupingBy(Function)
-
groupTo
@SequentialOnly public <M extends Map<K,List<V>>> M groupTo(Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-mapFactory
-- Returns:
- See Also:
Collectors.groupingBy(Function, Supplier)
-
groupTo
@ParallelSupported public <KK,VV> Map<KK,List<VV>> groupTo(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
-
groupTo
@ParallelSupported public <KK,VV,M extends Map<KK,List<VV>>> M groupTo(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-valueMapper
-mapFactory
-- Returns:
- See Also:
Collectors.toMultimap(Function, Function, Supplier)
-
groupToAndThen
@SequentialOnly public <R> R groupToAndThen(Function<? super Map<K,List<V>>,R> func)
-
toMultimap
@SequentialOnly public ListMultimap<K,V> toMultimap()
- Parameters:
keyMapper
-- Returns:
- See Also:
Collectors.toMultimap(Function, Function)
-
toMultimap
@SequentialOnly public <C extends Collection<V>,M extends Multimap<K,V,C>> M toMultimap(Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-mapFactory
-- Returns:
- See Also:
Collectors.toMultimap(Function, Function, Supplier)
-
toMultimap
@ParallelSupported public <KK,VV> ListMultimap<KK,VV> toMultimap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
- Parameters:
keyMapper
-valueMapper
-- Returns:
- See Also:
Collectors.toMultimap(Function, Function)
-
toMultimap
@ParallelSupported public <KK,VV,C extends Collection<VV>,M extends Multimap<KK,VV,C>> M toMultimap(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper, Supplier<? extends M> mapFactory)
- Parameters:
keyMapper
-valueMapper
-mapFactory
-- Returns:
- See Also:
Collectors.toMultimap(Function, Function, Supplier)
-
reduce
@ParallelSupported public Map.Entry<K,V> reduce(Map.Entry<K,V> identity, BinaryOperator<Map.Entry<K,V>> accumulator)
-
reduce
@ParallelSupported public u.Optional<Map.Entry<K,V>> reduce(BinaryOperator<Map.Entry<K,V>> accumulator)
-
collect
@ParallelSupported public <R> R collect(Supplier<R> supplier, BiConsumer<? super R,? super Map.Entry<K,V>> accumulator, BiConsumer<R,R> combiner)
-
collect
@ParallelSupported public <R> R collect(Supplier<R> supplier, BiConsumer<? super R,? super Map.Entry<K,V>> accumulator)
-
collect
@ParallelSupported public <R,A> R collect(Collector<? super Map.Entry<K,V>,A,R> collector)
-
collect
@ParallelSupported public <R,A> R collect(Collector<? super Map.Entry<K,V>,A,R> collector)
-
collectAndThen
@ParallelSupported public <R,A,RR> RR collectAndThen(Collector<? super Map.Entry<K,V>,A,R> downstream, Function<? super R,RR> finisher)
-
collectAndThen
@ParallelSupported public <R,A,RR> RR collectAndThen(Collector<? super Map.Entry<K,V>,A,R> downstream, Function<? super R,RR> finisher)
-
join
@SequentialOnly public String join(CharSequence delimiter)
-
join
@SequentialOnly public String join(CharSequence delimiter, CharSequence prefix, CharSequence suffix)
-
join
@SequentialOnly public String join(CharSequence delimiter, CharSequence keyValueDelimiter)
-
join
@SequentialOnly public String join(CharSequence delimiter, CharSequence keyValueDelimiter, CharSequence prefix, CharSequence suffix)
-
chain
@SequentialOnly public <KK,VV> EntryStream<KK,VV> chain(Function<? super Stream<Map.Entry<K,V>>,? extends Stream<Map.Entry<KK,VV>>> transfer)
-
__
@SequentialOnly @Beta public <KK,VV> EntryStream<KK,VV> __(Function<? super EntryStream<K,V>,EntryStream<KK,VV>> transfer)
-
sequential
public EntryStream<K,V> sequential()
-
parallel
public EntryStream<K,V> parallel()
-
parallel
public EntryStream<K,V> parallel(int threadNum)
-
parallel
public EntryStream<K,V> parallel(int maxThreadNum, BaseStream.Splitor splitor)
-
parallel
public EntryStream<K,V> parallel(int maxThreadNum, BaseStream.Splitor splitor, Executor executor)
-
parallel
public EntryStream<K,V> parallel(int maxThreadNum, Executor executor)
-
parallel
public EntryStream<K,V> parallel(Executor executor)
-
isParallel
public boolean isParallel()
-
inversedToDisposableEntry
@Deprecated @Beta @SequentialOnly public EntryStream<V,K> inversedToDisposableEntry()
Deprecated.- Returns:
- See Also:
Stream.mapToDisposableEntry(Function, Function)
-
mapToDisposableEntry
@Deprecated @Beta @SequentialOnly public <KK,VV> EntryStream<KK,VV> mapToDisposableEntry(Function<? super Map.Entry<K,V>,? extends KK> keyMapper, Function<? super Map.Entry<K,V>,? extends VV> valueMapper)
Deprecated.To reduce the memory footprint, Only one instance ofDisposableEntry
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.- Parameters:
keyMapper
-valueMapper
-- Returns:
- See Also:
NoCachingNoUpdating.DisposableEntry
,NoCachingNoUpdating
-
mapToDisposableEntry
@Deprecated @Beta @SequentialOnly public <KK,VV> EntryStream<KK,VV> mapToDisposableEntry(BiFunction<? super K,? super V,? extends KK> keyMapper, BiFunction<? super K,? super V,? extends VV> valueMapper)
Deprecated.- Parameters:
keyMapper
-valueMapper
-- Returns:
- See Also:
mapToDisposableEntry(Function, Function)
-
flatMapKeyToDisposableEntry
@Deprecated @Beta @SequentialOnly public <KK> EntryStream<KK,V> flatMapKeyToDisposableEntry(Function<? super K,? extends Stream<? extends KK>> keyMapper)
Deprecated.- Parameters:
keyMapper
-- Returns:
- See Also:
mapToDisposableEntry(Function, Function)
-
flattMapKeyToDisposableEntry
@Deprecated @Beta @SequentialOnly public <KK> EntryStream<KK,V> flattMapKeyToDisposableEntry(Function<? super K,? extends Collection<? extends KK>> keyMapper)
Deprecated.- Parameters:
keyMapper
-- Returns:
- See Also:
mapToDisposableEntry(Function, Function)
-
flatMapValueToDisposableEntry
@Deprecated @Beta @SequentialOnly public <VV> EntryStream<K,VV> flatMapValueToDisposableEntry(Function<? super V,? extends Stream<? extends VV>> valueMapper)
Deprecated.- Parameters:
valueMapper
-- Returns:
- See Also:
mapToDisposableEntry(Function, Function)
-
flattMapValueToDisposableEntry
@Deprecated @Beta @SequentialOnly public <VV> EntryStream<K,VV> flattMapValueToDisposableEntry(Function<? super V,? extends Collection<? extends VV>> valueMapper)
Deprecated.- Parameters:
valueMapper
-- Returns:
- See Also:
mapToDisposableEntry(Function, Function)
-
onClose
@SequentialOnly public EntryStream<K,V> onClose(Runnable closeHandler)
-
close
@SequentialOnly public void close()
- Specified by:
close
in interfaceAutoCloseable
-
empty
public static <K,V> EntryStream<K,V> empty()
-
ofNullable
public static <K,V> EntryStream<K,V> ofNullable(Map.Entry<K,V> entry)
-
of
public static <K,V> EntryStream<K,V> of(K k1, V v1)
-
of
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2)
-
of
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3)
-
of
public static <K,V> EntryStream<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
-
of
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)
-
of
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)
-
of
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)
-
of
public static <K,V> EntryStream<K,V> of(Map<K,V> map)
-
of
public static <K,V> EntryStream<K,V> of(Iterator<? extends Map.Entry<? extends K,? extends V>> iterator)
-
of
public static <K,V> EntryStream<K,V> of(Collection<? extends Map.Entry<? extends K,? extends V>> entries)
-
of
public static <E> EntryStream<E,Integer> of(Multiset<E> multiset)
-
of
public static <E> EntryStream<E,Long> of(LongMultiset<E> multiset)
-
of
public static <K,E,V extends Collection<E>> EntryStream<K,V> of(Multimap<K,E,V> mulitmap)
-
of
public static <K,T> EntryStream<K,T> of(T[] a, Function<? super T,K> keyMapper)
-
of
public static <K,T> EntryStream<K,T> of(Collection<? extends T> c, Function<? super T,K> keyMapper)
-
of
public static <K,T> EntryStream<K,T> of(Iterator<? extends T> iter, Function<? super T,K> keyMapper)
-
concat
@SafeVarargs public static <K,V> EntryStream<K,V> concat(Map<K,V>... maps)
-
concat
public static <K,V> EntryStream<K,V> concat(Collection<? extends Map<K,V>> maps)
-
merge
public static <K,V> EntryStream<K,V> merge(Map<K,V> a, Map<K,V> b, BiFunction<? super Map.Entry<K,V>,? super Map.Entry<K,V>,MergeResult> nextSelector)
-
merge
public static <K,V> EntryStream<K,V> merge(Map<K,V> a, Map<K,V> b, Map<K,V> c, BiFunction<? super Map.Entry<K,V>,? super Map.Entry<K,V>,MergeResult> nextSelector)
-
merge
public static <K,V> EntryStream<K,V> merge(Collection<? extends Map<K,V>> maps, BiFunction<? super Map.Entry<K,V>,? super Map.Entry<K,V>,MergeResult> nextSelector)
-
zip
public static <K,V> EntryStream<K,V> zip(K[] keys, V[] values)
-
zip
public static <K,V> EntryStream<K,V> zip(K[] keys, V[] values, K valueForNonKey, V valueForNonValue)
-
zip
public static <K,V> EntryStream<K,V> zip(Collection<? extends K> keys, Collection<? extends V> values)
-
zip
public static <K,V> EntryStream<K,V> zip(Collection<? extends K> keys, Collection<? extends V> values, K valueForNonKey, V valueForNonValue)
-
-