StandardDoubleStream class

Private implementation of DoubleStream that wraps an Iterable of doubles.

This implementation provides a way to create a DoubleStream from an existing Iterable of doubles, and also provides methods for performing operations on the stream.

StandardDoubleStream is designed to be used as a private implementation of DoubleStream, and should not be used directly.

See DoubleStream for more information on using streams of doubles.

Implemented types

Constructors

StandardDoubleStream(Iterable<double> _source, [bool _parallel = false, List<void Function()> _closeHandlers = const []])
StandardDoubleStream.empty()
factory
StandardDoubleStream.of(Iterable<double> values)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

allMatch(bool predicate(double)) bool
Returns true if all elements match the predicate.
override
anyMatch(bool predicate(double)) bool
Returns true if any element matches the predicate.
override
average() Optional<double>
Computes and returns the average, or an empty Optional if the stream is empty.
override
close() → void
Closes this stream, causing all close handlers for this stream pipeline to be called.
override
collect() List<double>
Returns a list containing the elements of this stream.
override
count() int
Returns the count of elements.
override
distinct() DoubleStream
Returns a stream with duplicate elements removed.
override
dropWhile(bool predicate(double)) DoubleStream
Drops elements while the predicate is true, then returns the remainder.
override
filter(bool predicate(double)) DoubleStream
Filters elements based on the given predicate.
override
findAny() Optional<double>
Returns any element of the stream.
override
findFirst() Optional<double>
Returns the first element, if available.
override
flatMap(DoubleStream mapper(double)) DoubleStream
Flattens nested DoubleStreams generated by the mapping function.
override
forEach(void action(double)) → void
Applies the provided action to each element.
override
forEachOrdered(void action(double)) → void
Applies the action to elements in encounter order.
override
isParallel() bool
Returns whether this stream, if a terminal operation were to be executed, would execute in parallel.
override
iterable() Iterable<double>
Returns an iterable for the elements of this stream.
override
iterator() Iterator<double>
Returns an iterator for the elements of this stream.
override
limit(int maxSize) DoubleStream
Limits the stream to at most maxSize elements.
override
map(double mapper(double)) DoubleStream
Transforms each element using the provided mapping function.
override
mapToInt(int mapper(double)) IntStream
Maps each element to an int, returning an IntStream.
override
max() Optional<double>
Returns the maximum element or an empty Optional.
override
min() Optional<double>
Returns the minimum element or an empty Optional.
override
noneMatch(bool predicate(double)) bool
Returns true if none match the predicate.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose(void closeHandler()) DoubleStream
Returns an equivalent stream with an additional close handler.
override
parallel() DoubleStream
Returns an equivalent stream that is parallel.
override
peek(void action(double)) DoubleStream
Applies the action to each element and returns the same stream.
override
reduce(double identity, double op(double, double)) double
Reduces the stream using the identity and associative binary operator.
override
reduceOptional(double op(double, double)) Optional<double>
Returns an Optional reduction result.
override
sequential() DoubleStream
Returns an equivalent stream that is sequential.
override
skip(int n) DoubleStream
Skips the first n elements.
override
sorted() DoubleStream
Returns the stream sorted in natural (ascending) order.
override
sum() double
Sums the elements of the stream.
override
takeWhile(bool predicate(double)) DoubleStream
Takes elements while the predicate returns true.
override
toList() List<double>
Collects elements into a List of double.
override
toString() String
A string representation of this object.
inherited
unordered() DoubleStream
Returns an equivalent stream that is unordered.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited