GroupByStreamTransformer<T, K> class
The GroupBy operator divides a Stream that emits items into a Stream that emits GroupedStream, each one of which emits some subset of the items from the original source Stream.
GroupedStream acts like a regular Stream, yet
adding a 'key' property, which receives its Type and value from
the _grouper
Function.
All items with the same key are emitted by the same GroupedStream.
- Inheritance
-
- Object
- StreamTransformerBase<
T, GroupedStream< T, K> > - GroupByStreamTransformer
Constructors
-
GroupByStreamTransformer(K grouper(T event), {Stream<
void> durationSelector(GroupedStream<T, K> grouped)?}) - Constructs a StreamTransformer which groups events from the source Stream and emits them as GroupedStream.
Properties
-
durationSelector
→ Stream<
void> Function(GroupedStream<T, K> grouped)? -
A function that returns an Stream to determine how long each group should exist.
When the returned Stream emits its first data or done event,
the group will be closed and removed.
final
- grouper → K Function(T event)
-
Method which converts incoming events into a new GroupedStream
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
Stream< T> stream) → Stream<GroupedStream< T, K> > -
Transforms the provided
stream
.override -
cast<
RS, RT> () → StreamTransformer< RS, RT> -
Provides a
StreamTransformer<RS, RT>
view of this stream transformer.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited