Interface IntStream
- All Superinterfaces:
AutoCloseable, BaseStream<Integer, IntStream>
A sequence of int values to which operations are applied one stage at a
time, evaluated lazily, one element at a time, when a terminal operation
asks for them.
Streams here are sequential: parallel() answers the same stream, which
the JDK allows a parallel stream to be.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanallMatch(IntPredicate predicate) booleananyMatch(IntPredicate predicate) average()boxed()<R> Rcollect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner) static IntStreamThe elements ofa, then those ofb.longcount()distinct()dropWhile(IntPredicate predicate) static IntStreamempty()filter(IntPredicate predicate) findAny()flatMap(IntFunction<? extends IntStream> mapper) voidforEach(IntConsumer action) voidforEachOrdered(IntConsumer action) static IntStreamThe valuessanswers, one call per element, without end.static IntStreamiterate(int seed, IntPredicate hasNext, IntUnaryOperator next) Asiterate(int, IntUnaryOperator), ending before the first valuehasNextrefuses.static IntStreamiterate(int seed, IntUnaryOperator f) seed, thenfapplied to it, thenfapplied to that, without end.iterator()limit(long maxSize) map(IntUnaryOperator mapper) mapToDouble(IntToDoubleFunction mapper) mapToLong(IntToLongFunction mapper) <U> Stream<U> mapToObj(IntFunction<? extends U> mapper) max()min()booleannoneMatch(IntPredicate predicate) static IntStreamof(int value) static IntStreamof(int... values) parallel()Declared again with this type; seesequential().peek(IntConsumer action) static IntStreamrange(int startInclusive, int endExclusive) The values fromstartInclusiveup to, not including,endExclusive, in steps of one.static IntStreamrangeClosed(int startInclusive, int endInclusive) The values fromstartInclusiveup to and includingendInclusive, in steps of one.intreduce(int identity, IntBinaryOperator op) Declared again with this type, as the JDK does: a call compiled against the JDK namesIntStream.sequential()answeringIntStream, and the method inherited fromBaseStreamanswers its type variable, which is another descriptor.skip(long n) sorted()intsum()takeWhile(IntPredicate predicate) int[]toArray()Methods inherited from interface BaseStream
close, isParallel, onClose, unordered
-
Method Details
-
sequential
IntStream sequential()Declared again with this type, as the JDK does: a call compiled against the JDK namesIntStream.sequential()answeringIntStream, and the method inherited fromBaseStreamanswers its type variable, which is another descriptor.- Specified by:
sequentialin interfaceBaseStream<Integer, IntStream>
-
parallel
IntStream parallel()Declared again with this type; seesequential().- Specified by:
parallelin interfaceBaseStream<Integer, IntStream>
-
filter
-
map
-
mapToObj
-
mapToLong
-
mapToDouble
-
flatMap
-
distinct
IntStream distinct() -
sorted
IntStream sorted() -
peek
-
limit
-
skip
-
takeWhile
-
dropWhile
-
forEach
-
forEachOrdered
-
toArray
int[] toArray() -
reduce
-
reduce
-
collect
-
sum
int sum() -
min
OptionalInt min() -
max
OptionalInt max() -
count
long count() -
average
OptionalDouble average() -
summaryStatistics
IntSummaryStatistics summaryStatistics() -
anyMatch
-
allMatch
-
noneMatch
-
findFirst
OptionalInt findFirst() -
findAny
OptionalInt findAny() -
asLongStream
LongStream asLongStream() -
asDoubleStream
DoubleStream asDoubleStream() -
boxed
-
iterator
PrimitiveIterator.OfInt iterator()- Specified by:
iteratorin interfaceBaseStream<Integer, IntStream>
-
empty
-
of
-
of
-
iterate
seed, thenfapplied to it, thenfapplied to that, without end. -
iterate
Asiterate(int, IntUnaryOperator), ending before the first valuehasNextrefuses. -
generate
The valuessanswers, one call per element, without end. -
range
The values fromstartInclusiveup to, not including,endExclusive, in steps of one. Empty whenstartInclusiveis not belowendExclusive. -
rangeClosed
The values fromstartInclusiveup to and includingendInclusive, in steps of one. Empty whenstartInclusiveis aboveendInclusive. -
concat
-