ScanStreamTransformer<S, T> class

Applies an accumulator function over an stream sequence and returns each intermediate result. The seed value is used as the initial accumulator value.

Example

Stream.fromIterable([1, 2, 3])
   .transform(ScanStreamTransformer((acc, curr, i) => acc + curr, 0))
   .listen(print); // prints 1, 3, 6
Inheritance

Constructors

ScanStreamTransformer(T accumulator(T accumulated, S value, int index), T seed)
Constructs a ScanStreamTransformer which applies an accumulator Function over the source Stream and returns each intermediate result. The seed value is used as the initial accumulator value.

Properties

accumulator → T Function(T accumulated, S value, int index)
Method which accumulates incoming event into a single, accumulated object
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed → T
The initial value for the accumulated value in the accumulator
final

Methods

bind(Stream<S> stream) Stream<T>
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