Module org.tquadrat.foundation.base
Class DefaultMapStream<K,V>
java.lang.Object
org.tquadrat.foundation.stream.internal.DefaultMapStream<K,V>
- Type Parameters:
K
- The type of the map keys.V
- The type of the map values.
- All Implemented Interfaces:
AutoCloseable
,BaseStream<Map.Entry<K,
,V>, Stream<Map.Entry<K, V>>> Stream<Map.Entry<K,
,V>> MapStream<K,
V>
@ClassVersion(sourceVersion="$Id: DefaultMapStream.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=INTERNAL,
since="0.0.7")
public final class DefaultMapStream<K,V>
extends Object
implements MapStream<K,V>
The default implementation for
MapStream
.- Author:
- Alexis Cartier (alexcrt), Dominic Fox
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: DefaultMapStream.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.7
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.stream.internal.DefaultMapStream"
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe wrapped stream. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMapStream
(Stream<Map.Entry<K, V>> stream) Creates a newDefaultMapStream
instance from the provided stream. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final boolean
final void
close()
final <R> R
collect
(Supplier<R> supplier, BiConsumer<R, ? super Map.Entry<K, V>> accumulator, BiConsumer<R, R> combiner) final <R,
A> R final long
count()
distinct()
findAny()
final <R> Stream
<R> final DoubleStream
flatMapToDouble
(Function<? super Map.Entry<K, V>, ? extends DoubleStream> mapper) final IntStream
final LongStream
flatMapToLong
(Function<? super Map.Entry<K, V>, ? extends LongStream> mapper) final void
final void
forEachOrdered
(Consumer<? super Map.Entry<K, V>> action) final boolean
iterator()
limit
(long maxSize) final <R> Stream
<R> final DoubleStream
mapToDouble
(ToDoubleFunction<? super Map.Entry<K, V>> mapper) final IntStream
mapToInt
(ToIntFunction<? super Map.Entry<K, V>> mapper) final LongStream
mapToLong
(ToLongFunction<? super Map.Entry<K, V>> mapper) max
(Comparator<? super Map.Entry<K, V>> comparator) min
(Comparator<? super Map.Entry<K, V>> comparator) final boolean
parallel()
reduce
(BinaryOperator<Map.Entry<K, V>> accumulator) final <U> U
reduce
(U identity, BiFunction<U, ? super Map.Entry<K, V>, U> accumulator, BinaryOperator<U> combiner) skip
(long n) sorted()
sorted
(Comparator<? super Map.Entry<K, V>> comparator) final Spliterator
<Map.Entry<K, V>> final Object[]
toArray()
final <A> A[]
toArray
(IntFunction<A[]> generator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tquadrat.foundation.stream.MapStream
collect, collect, dropKeys, dropValues, filter, forEach, inverseMapping, map, mapEntries, mapKeys, mapValues, mergeKeys, mergeKeys
Methods inherited from interface java.util.stream.Stream
dropWhile, mapMulti, mapMultiToDouble, mapMultiToInt, mapMultiToLong, takeWhile, toList
-
Field Details
-
m_Delegate
The wrapped stream.
-
-
Constructor Details
-
DefaultMapStream
Creates a newDefaultMapStream
instance from the provided stream.- Parameters:
stream
- The stream to wrap.
-
-
Method Details
-
allMatch
-
anyMatch
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<K,
V>
-
collect
-
collect
public final <R> R collect(Supplier<R> supplier, BiConsumer<R, ? super Map.Entry<K, V>> accumulator, BiConsumer<R, R> combiner) -
count
-
distinct
-
filter
-
findAny
-
findFirst
-
flatMap
-
flatMapToDouble
public final DoubleStream flatMapToDouble(Function<? super Map.Entry<K, V>, ? extends DoubleStream> mapper) - Specified by:
flatMapToDouble
in interfaceStream<K>
-
flatMapToInt
- Specified by:
flatMapToInt
in interfaceStream<K>
-
flatMapToLong
- Specified by:
flatMapToLong
in interfaceStream<K>
-
forEach
-
forEachOrdered
- Specified by:
forEachOrdered
in interfaceStream<K>
-
isParallel
- Specified by:
isParallel
in interfaceBaseStream<K,
V>
-
iterator
- Specified by:
iterator
in interfaceBaseStream<K,
V>
-
limit
-
map
-
mapToDouble
- Specified by:
mapToDouble
in interfaceStream<K>
-
mapToInt
-
mapToLong
-
max
-
min
-
noneMatch
-
onClose
-
parallel
-
peek
-
reduce
-
reduce
-
reduce
public final <U> U reduce(U identity, BiFunction<U, ? super Map.Entry<K, V>, U> accumulator, BinaryOperator<U> combiner) -
sequential
- Specified by:
sequential
in interfaceBaseStream<K,
V> - Specified by:
sequential
in interfaceMapStream<K,
V>
-
skip
-
sorted
-
sorted
-
spliterator
- Specified by:
spliterator
in interfaceBaseStream<K,
V> - See Also:
-
toArray
-
toArray
-
unordered
-