Collector
Collector:
object
Defined in: src/stream/Collectors.ts:27
Factory and characteristic constants for Collector.
Type Declaration
Section titled “Type Declaration”Characteristics
Section titled “Characteristics”Characteristics:
object
The characteristic names as constants; the same strings as CollectorCharacteristics.
Characteristics.CONCURRENT
Section titled “Characteristics.CONCURRENT”
readonlyCONCURRENT:"CONCURRENT"='CONCURRENT'
One container may be fed concurrently; no effect on the single JS thread.
Characteristics.IDENTITY_FINISH
Section titled “Characteristics.IDENTITY_FINISH”
readonlyIDENTITY_FINISH:"IDENTITY_FINISH"='IDENTITY_FINISH'
The finisher is the identity: the container is the result and the finisher is skipped.
Characteristics.UNORDERED
Section titled “Characteristics.UNORDERED”
readonlyUNORDERED:"UNORDERED"='UNORDERED'
The result does not depend on encounter order.
of: {<
T,R>(supplier,accumulator,combiner, …characteristics):Collector<T,R,R>; <T,A,R>(supplier,accumulator,combiner,finisher, …characteristics):Collector<T,A,R>; }
Collector from functions. Without a finisher the result is the container and IDENTITY_FINISH is always reported; with one, exactly the given characteristics are reported.
Call Signature
Section titled “Call Signature”<
T,R>(supplier,accumulator,combiner, …characteristics):Collector<T,R,R>
A collector whose container is the result: IDENTITY_FINISH is always reported, plus the given characteristics.
Type Parameters
Section titled “Type Parameters”T
R
Parameters
Section titled “Parameters”supplier
Section titled “supplier”() => R
accumulator
Section titled “accumulator”(r, t) => void
combiner
Section titled “combiner”(a, b) => R
characteristics
Section titled “characteristics”Returns
Section titled “Returns”Collector<T, R, R>
Call Signature
Section titled “Call Signature”<
T,A,R>(supplier,accumulator,combiner,finisher, …characteristics):Collector<T,A,R>
A collector with a finisher; exactly the given characteristics are reported.
Type Parameters
Section titled “Type Parameters”T
A
R
Parameters
Section titled “Parameters”supplier
Section titled “supplier”() => A
accumulator
Section titled “accumulator”(a, t) => void
combiner
Section titled “combiner”(a, b) => A
finisher
Section titled “finisher”(a) => R
characteristics
Section titled “characteristics”Returns
Section titled “Returns”Collector<T, A, R>
Throws
Section titled “Throws”NullPointerException if any function or characteristic is null