StandardIntStream class

Private implementation of IntStream.

This class is a low-level, mutable implementation of IntStream. It is not intended to be used directly, but rather to support the implementation of IntStream.

See the documentation for IntStream for the API specification.

Implemented types

Constructors

StandardIntStream(Iterable<int> _source, [bool _parallel = false, List<void Function()> _closeHandlers = const []])
StandardIntStream.empty()
factory
StandardIntStream.of(Iterable<int> values)
factory
StandardIntStream.range(int startInclusive, int endExclusive)
factory
StandardIntStream.rangeClosed(int startInclusive, int endInclusive)
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(int)) → bool
Returns true if all elements match the predicate.
override
anyMatch(bool predicate(int)) → bool
Returns true if any elements match the predicate.
override
asDoubleStream() → DoubleStream
Converts this IntStream to a DoubleStream.
override
average() → double
Returns the arithmetic mean of values in the stream.
override
close() → void
Closes this stream, causing all close handlers for this stream pipeline to be called.
override
collect() → List<int>
Returns a list containing the elements of this stream.
override
count() → int
Returns the count of elements in the stream.
override
distinct() → IntStream
Returns a stream with duplicate elements removed.
override
dropWhile(bool predicate(int)) → IntStream
Drops elements from the stream while the predicate returns true, then returns the remaining elements.
override
filter(bool predicate(int)) → IntStream
Returns a stream consisting of elements that match the given predicate.
override
findAny() → Optional<int>
Returns any element from the stream, which may be useful in parallel contexts.
override
findFirst() → Optional<int>
Returns the first element of the stream, if present.
override
flatMap(IntStream mapper(int)) → IntStream
Returns a stream consisting of the results of replacing each element with the contents of a mapped stream.
override
forEach(void action(int)) → void
Performs the given action for each element of the stream.
override
forEachOrdered(void action(int)) → void
Performs the given action for each element, respecting the encounter order.
override
isParallel() → bool
Returns whether this stream, if a terminal operation were to be executed, would execute in parallel.
override
iterable() → Iterable<int>
Returns an iterable for the elements of this stream.
override
iterator() → Iterator<int>
Returns an iterator for the elements of this stream.
override
limit(int maxSize) → IntStream
Truncates the stream to be no longer than maxSize.
override
map(int mapper(int)) → IntStream
Returns a stream consisting of the results of applying the given function to the elements of this stream.
override
mapToDouble(double mapper(int)) → DoubleStream
Returns a DoubleStream consisting of the results of applying the given function to the elements of this stream.
override
max() → Optional<int>
Returns the maximum value as an Optional, or empty if the stream is empty.
override
min() → Optional<int>
Returns the minimum value as an Optional, or empty if the stream is empty.
override
noneMatch(bool predicate(int)) → bool
Returns true if no elements match the predicate.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose(void closeHandler()) → IntStream
Returns an equivalent stream with an additional close handler.
override
parallel() → IntStream
Returns an equivalent stream that is parallel.
override
peek(void action(int)) → IntStream
Returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as they are consumed.
override
reduce(int identity, int op(int, int)) → int
Performs a reduction on the elements using the given identity and associative accumulation function.
override
reduceOptional(int op(int, int)) → Optional<int>
Performs a reduction and returns an Optional of the result.
override
sequential() → IntStream
Returns an equivalent stream that is sequential.
override
skip(int n) → IntStream
Skips the first n elements of the stream.
override
sorted() → IntStream
Returns a stream with elements sorted in natural ascending order.
override
sum() → int
Returns the sum of the elements.
override
takeWhile(bool predicate(int)) → IntStream
Returns a stream consisting of the elements taken from this stream until the predicate returns false.
override
toList() → List<int>
Collects the elements into a List.
override
toString() → String
A string representation of this object.
inherited
unordered() → IntStream
Returns an equivalent stream that is unordered.
override

Operators

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