StreamSupport
constStreamSupport:object
Defined in: src/stream/StreamSupport.ts:57
Low-level stream construction from a Spliterator, for custom sources: stream, intStream, longStream
and doubleStream. Each has two forms:
(spliterator, parallel), and (supplier, characteristics, parallel), which calls supplier once, when the
terminal operation starts or spliterator()/iterator() is first used, so the source binds late. parallel only
sets the flag isParallel() reports; evaluation is sequential.
Type Declaration
Section titled “Type Declaration”doubleStream
Section titled “doubleStream”doubleStream: {(
spliterator,parallel):DoubleStream; (supplier,characteristics,parallel):DoubleStream; }
Creates a DoubleStream over a double spliterator, or over a supplier of one bound late.
Call Signature
Section titled “Call Signature”(
spliterator,parallel):DoubleStream
Returns a DoubleStream over spliterator; parallel only sets isParallel().
Parameters
Section titled “Parameters”spliterator
Section titled “spliterator”Spliterator<number>
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”DoubleStream
Call Signature
Section titled “Call Signature”(
supplier,characteristics,parallel):DoubleStream
Returns a DoubleStream whose spliterator supplier creates late; characteristics must match what it reports.
Parameters
Section titled “Parameters”supplier
Section titled “supplier”() => Spliterator<number>
characteristics
Section titled “characteristics”number
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”DoubleStream
intStream
Section titled “intStream”intStream: {(
spliterator,parallel):IntStream; (supplier,characteristics,parallel):IntStream; }
Creates an IntStream over an int spliterator, or over a supplier of one bound late.
Call Signature
Section titled “Call Signature”(
spliterator,parallel):IntStream
Returns an IntStream over spliterator; parallel only sets isParallel().
Parameters
Section titled “Parameters”spliterator
Section titled “spliterator”Spliterator<number>
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”IntStream
Call Signature
Section titled “Call Signature”(
supplier,characteristics,parallel):IntStream
Returns an IntStream whose spliterator supplier creates late; characteristics must match what it reports.
Parameters
Section titled “Parameters”supplier
Section titled “supplier”() => Spliterator<number>
characteristics
Section titled “characteristics”number
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”IntStream
longStream
Section titled “longStream”longStream: {(
spliterator,parallel):LongStream; (supplier,characteristics,parallel):LongStream; }
Creates a LongStream over a long spliterator, or over a supplier of one bound late.
Call Signature
Section titled “Call Signature”(
spliterator,parallel):LongStream
Returns a LongStream over spliterator; parallel only sets isParallel().
Parameters
Section titled “Parameters”spliterator
Section titled “spliterator”Spliterator<number>
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”LongStream
Call Signature
Section titled “Call Signature”(
supplier,characteristics,parallel):LongStream
Returns a LongStream whose spliterator supplier creates late; characteristics must match what it reports.
Parameters
Section titled “Parameters”supplier
Section titled “supplier”() => Spliterator<number>
characteristics
Section titled “characteristics”number
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”LongStream
stream
Section titled “stream”stream: {<
T>(spliterator,parallel):Stream<T>; <T>(supplier,characteristics,parallel):Stream<T>; }
Creates a Stream over a spliterator, or over a spliterator supplier bound late (see StreamSupport).
Call Signature
Section titled “Call Signature”<
T>(spliterator,parallel):Stream<T>
Returns a Stream over spliterator; parallel only sets isParallel().
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”spliterator
Section titled “spliterator”Spliterator<T>
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”Stream<T>
Call Signature
Section titled “Call Signature”<
T>(supplier,characteristics,parallel):Stream<T>
Returns a Stream whose spliterator supplier creates late, when the terminal operation starts; characteristics must match what it reports.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”supplier
Section titled “supplier”() => Spliterator<T>
characteristics
Section titled “characteristics”number
parallel
Section titled “parallel”boolean
Returns
Section titled “Returns”Stream<T>
Throws
Section titled “Throws”NullPointerException if the spliterator or supplier is null