Collector
Defined in: src/stream/Collectors.ts:27
A mutable reduction for stream.collect: supplier, accumulator, combiner, finisher and characteristics. The
Collector value holds Collector.of and Collector.Characteristics; ready-made ones are in Collectors.
Extends
Section titled “Extends”Collector<T,A,R>
Type Parameters
Section titled “Type Parameters”T
A
R
Methods
Section titled “Methods”accumulator()
Section titled “accumulator()”accumulator(): (
container,t) =>void
Defined in: src/stream/Collector.ts:22
Returns the function that adds one element to a container.
Returns
Section titled “Returns”(container, t) => void
Inherited from
Section titled “Inherited from”CollectorType.accumulator
characteristics()
Section titled “characteristics()”characteristics():
Set<CollectorCharacteristics>
Defined in: src/stream/Collector.ts:28
Returns this collector’s characteristics; stream.collect skips the finisher when it contains IDENTITY_FINISH.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”CollectorType.characteristics
combiner()
Section titled “combiner()”combiner(): (
a,b) =>A
Defined in: src/stream/Collector.ts:24
Returns the function that merges two containers and returns the result (either one, or a new container).
Returns
Section titled “Returns”(a, b) => A
Inherited from
Section titled “Inherited from”CollectorType.combiner
finisher()
Section titled “finisher()”finisher(): (
container) =>R
Defined in: src/stream/Collector.ts:26
Returns the function that turns the final container into the result.
Returns
Section titled “Returns”(container) => R
Inherited from
Section titled “Inherited from”CollectorType.finisher
supplier()
Section titled “supplier()”supplier(): () =>
A
Defined in: src/stream/Collector.ts:20
Returns the function that creates a new, empty container.
Returns
Section titled “Returns”() => A
Inherited from
Section titled “Inherited from”CollectorType.supplier