namespace Stream
A possibly infinite sequence of elements of type T. See the Stream documentation and the Stream API documentation
Companion interface: Stream<T>
Interfaces
Name | Description |
---|---|
Stream.NonEmpty<T> | A non-empty and possibly infinite sequence of elements of type T. See the Stream documentation and the Stream API documentation |
Static Methods
always
Returns a Stream that eternally returns the given value
.
always
value
.applyFilter
For a Stream of tuples in given source
, returns a Stream where the result of supplying each tuple element as an argument to given mapFun
function for each element of the Stream, with the optionally given args
as extra arguments, is true.
applyFilter
source
, returns a Stream where the result of supplying each tuple element as an argument to given mapFun
function for each element of the Stream, with the optionally given args
as extra arguments, is true.applyForEach
For a Stream of tuples, supplied each tuple element as an argument to given function f
for each element of the Stream, with the optionally given args
as extra arguments.
applyForEach
f
for each element of the Stream, with the optionally given args
as extra arguments.applyMap
For a Stream of tuples in given source
, returns a Stream with the result of supplying each tuple element as an argument to given mapFun
function for each element of the Stream, with the optionally given args
as extra arguments.
applyMap
source
, returns a Stream with the result of supplying each tuple element as an argument to given mapFun
function for each element of the Stream, with the optionally given args
as extra arguments.empty
Returns an empty Stream of given type T.
empty
flatten
Returns a Stream concatenating the given source
StreamSource containing StreamSources.
flatten
source
StreamSource containing StreamSources.from
Returns a Stream containing the values in the given sources
concatenated
from
sources
concatenatedfromArray
Returns a Stream returning elements from the given array
, taking into account the given options.
fromArray
array
, taking into account the given options.fromObject
Returns a Stream consisting of the object entries as tuples from the given obj
object.
fromObject
obj
object.fromObjectKeys
Returns a Stream consisting of the object keys from the given obj
object.
fromObjectKeys
obj
object.fromObjectValues
Returns a Stream consisting of the object values from the given obj
object.
fromObjectValues
obj
object.fromString
Returns a Stream consisting of the characters from given string source
, taking into account the given options.
fromString
source
, taking into account the given options.of
Returns a non-empty Stream containing the given values
of
values
random
Returns an infinite Stream containing random numbers between 0 and 1.
random
randomInt
Returns an infinite Stream containing random integer numbers between given min
and max
randomInt
min
and max
range
Returns a Stream of numbers within the given range
, increasing or decreasing with optionally given delta
.
range
range
, increasing or decreasing with optionally given delta
.unfold
Returns a possibly infinite Stream starting with given init
value, followed by applying given next
function to the previous value.
unfold
init
value, followed by applying given next
function to the previous value.unzip
Returns an array containing a Stream for each tuple element in this stream.
unzip
zip
Returns a Stream with tuples containing each successive value from the given sources
.
zip
sources
.zipAll
Returns a Stream with tuples containing each successive value from the given sources
, adding given fillValue
to any Streams that end before all streams have ended.
zipAll
sources
, adding given fillValue
to any Streams that end before all streams have ended.zipAllWith
Returns a Stream with the result of applying given zipFun
to each successive value resulting from the given sources
, adding given fillValue
to any Streams that end before all streams have ended.
zipAllWith
zipFun
to each successive value resulting from the given sources
, adding given fillValue
to any Streams that end before all streams have ended.zipWith
Returns a Stream with the result of applying given zipFun
to each successive value resulting from the given sources
.
zipWith
zipFun
to each successive value resulting from the given sources
.