java.lang.Object
org.tquadrat.foundation.stream.StreamAdapter<T>
- Type Parameters:
T
- The type of the stream's elements.
- All Implemented Interfaces:
AutoCloseable
,BaseStream<T,
,Stream<T>> Stream<T>
@ClassVersion(sourceVersion="$Id: StreamAdapter.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=STABLE,
since="0.0.7")
public class StreamAdapter<T>
extends Object
implements Stream<T>
This class allows to intercept the calls to the methods of
Stream
. The default implementations of the methods will just
delegate to the wrapped stream.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: StreamAdapter.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.7
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.stream.StreamAdapter"
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
close()
<R> R
collect
(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> combiner) <R,
A> R long
count()
distinct()
findAny()
<R> Stream
<R> flatMapToDouble
(Function<? super T, ? extends DoubleStream> mapper) flatMapToInt
(Function<? super T, ? extends IntStream> mapper) flatMapToLong
(Function<? super T, ? extends LongStream> mapper) void
void
forEachOrdered
(Consumer<? super T> action) boolean
iterator()
limit
(long maxSize) <R> Stream
<R> mapToDouble
(ToDoubleFunction<? super T> mapper) mapToInt
(ToIntFunction<? super T> mapper) mapToLong
(ToLongFunction<? super T> mapper) max
(Comparator<? super T> comparator) min
(Comparator<? super T> comparator) boolean
parallel()
reduce
(BinaryOperator<T> accumulator) reduce
(T identity, BinaryOperator<T> accumulator) <U> U
reduce
(U identity, BiFunction<U, ? super T, U> accumulator, BinaryOperator<U> combiner) skip
(long n) sorted()
sorted
(Comparator<? super T> comparator) Object[]
toArray()
<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 java.util.stream.Stream
mapMulti, mapMultiToDouble, mapMultiToInt, mapMultiToLong, toList
-
Field Details
-
m_Wrapped
The wrapped stream.
-
-
Constructor Details
-
StreamAdapter
Creates a newStreamAdapter
instance.- Parameters:
wrapped
- The stream that is wrapped by this adapter.
-
-
Method Details
-
allMatch
-
anyMatch
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<T,
Stream<T>>
-
collect
-
collect
@MountPoint public <R> R collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> combiner) -
count
-
distinct
-
dropWhile
-
filter
-
findAny
-
findFirst
-
flatMap
-
flatMapToDouble
- Specified by:
flatMapToDouble
in interfaceStream<T>
-
flatMapToInt
- Specified by:
flatMapToInt
in interfaceStream<T>
-
flatMapToLong
- Specified by:
flatMapToLong
in interfaceStream<T>
-
forEach
-
forEachOrdered
- Specified by:
forEachOrdered
in interfaceStream<T>
-
isParallel
- Specified by:
isParallel
in interfaceBaseStream<T,
Stream<T>>
-
iterator
- Specified by:
iterator
in interfaceBaseStream<T,
Stream<T>>
-
limit
-
map
-
mapToDouble
- Specified by:
mapToDouble
in interfaceStream<T>
-
mapToInt
-
mapToLong
-
max
-
min
-
noneMatch
-
onClose
- Specified by:
onClose
in interfaceBaseStream<T,
Stream<T>>
-
parallel
- Specified by:
parallel
in interfaceBaseStream<T,
Stream<T>>
-
peek
-
reduce
-
reduce
-
reduce
@MountPoint public <U> U reduce(U identity, BiFunction<U, ? super T, U> accumulator, BinaryOperator<U> combiner) -
sequential
- Specified by:
sequential
in interfaceBaseStream<T,
Stream<T>>
-
skip
-
sorted
-
sorted
-
spliterator
- Specified by:
spliterator
in interfaceBaseStream<T,
Stream<T>>
-
takeWhile
-
toArray
-
toArray
-
unordered
- Specified by:
unordered
in interfaceBaseStream<T,
Stream<T>>
-