Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public interface IntStream

ExtendsAutoCloseable, 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.

Methods

public abstract IntStream sequential()Declared again with this type, as the JDK does: a call compiled against the JDK names IntStream.sequential() answering IntStream, and the method inherited from BaseStream answers its type variable, which is another descriptor.
public abstract IntStream parallel()Declared again with this type; see sequential().
public abstract IntStream filter(IntPredicate predicate)
public abstract IntStream map(IntUnaryOperator mapper)
public abstract <U> Stream<U> mapToObj(IntFunction<? extends U> mapper)
public abstract LongStream mapToLong(IntToLongFunction mapper)
public abstract DoubleStream mapToDouble(IntToDoubleFunction mapper)
public abstract IntStream flatMap(IntFunction<? extends IntStream> mapper)
public abstract IntStream distinct()
public abstract IntStream sorted()
public abstract IntStream peek(IntConsumer action)
public abstract IntStream limit(long maxSize)
public abstract IntStream skip(long n)
public abstract IntStream takeWhile(IntPredicate predicate)
public abstract IntStream dropWhile(IntPredicate predicate)
public abstract void forEach(IntConsumer action)
public abstract void forEachOrdered(IntConsumer action)
public abstract int[] toArray()
public abstract int reduce(int identity, IntBinaryOperator op)
public abstract OptionalInt reduce(IntBinaryOperator op)
public abstract <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner)
public abstract int sum()
public abstract OptionalInt min()
public abstract OptionalInt max()
public abstract long count()
public abstract OptionalDouble average()
public abstract IntSummaryStatistics summaryStatistics()
public abstract boolean anyMatch(IntPredicate predicate)
public abstract boolean allMatch(IntPredicate predicate)
public abstract boolean noneMatch(IntPredicate predicate)
public abstract OptionalInt findFirst()
public abstract OptionalInt findAny()
public abstract LongStream asLongStream()
public abstract DoubleStream asDoubleStream()
public abstract Stream<Integer> boxed()
public abstract PrimitiveIterator.OfInt iterator()
public static IntStream empty()
public static IntStream of(int value)
public static IntStream of(int... values)
public static IntStream iterate(int seed, IntUnaryOperator f)seed, then f applied to it, then f applied to that, without end.
public static IntStream iterate(int seed, IntPredicate hasNext, IntUnaryOperator next)As iterate(int, IntUnaryOperator), ending before the first value hasNext refuses.
public static IntStream generate(IntSupplier s)The values s answers, one call per element, without end.
public static IntStream range(int startInclusive, int endExclusive)The values from startInclusive up to, not including, endExclusive, in steps of one.
public static IntStream rangeClosed(int startInclusive, int endInclusive)The values from startInclusive up to and including endInclusive, in steps of one.
public static IntStream concat(IntStream a, IntStream b)The elements of a, then those of b.

Inherited methods

Method details

sequential

public abstract IntStream sequential()
Declared again with this type, as the JDK does: a call compiled against the JDK names IntStream.sequential() answering IntStream, and the method inherited from BaseStream answers its type variable, which is another descriptor.

parallel

public abstract IntStream parallel()
Declared again with this type; see sequential().

filter

public abstract IntStream filter(IntPredicate predicate)

map

public abstract IntStream map(IntUnaryOperator mapper)

mapToObj

public abstract <U> Stream<U> mapToObj(IntFunction<? extends U> mapper)

mapToLong

public abstract LongStream mapToLong(IntToLongFunction mapper)

mapToDouble

public abstract DoubleStream mapToDouble(IntToDoubleFunction mapper)

flatMap

public abstract IntStream flatMap(IntFunction<? extends IntStream> mapper)

distinct

public abstract IntStream distinct()

sorted

public abstract IntStream sorted()

peek

public abstract IntStream peek(IntConsumer action)

limit

public abstract IntStream limit(long maxSize)

skip

public abstract IntStream skip(long n)

takeWhile

public abstract IntStream takeWhile(IntPredicate predicate)

dropWhile

public abstract IntStream dropWhile(IntPredicate predicate)

forEach

public abstract void forEach(IntConsumer action)

forEachOrdered

public abstract void forEachOrdered(IntConsumer action)

toArray

public abstract int[] toArray()

reduce

public abstract int reduce(int identity, IntBinaryOperator op)

reduce

public abstract OptionalInt reduce(IntBinaryOperator op)

collect

public abstract <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R, R> combiner)

sum

public abstract int sum()

min

public abstract OptionalInt min()

max

public abstract OptionalInt max()

count

public abstract long count()

average

public abstract OptionalDouble average()

summaryStatistics

public abstract IntSummaryStatistics summaryStatistics()

anyMatch

public abstract boolean anyMatch(IntPredicate predicate)

allMatch

public abstract boolean allMatch(IntPredicate predicate)

noneMatch

public abstract boolean noneMatch(IntPredicate predicate)

findFirst

public abstract OptionalInt findFirst()

findAny

public abstract OptionalInt findAny()

asLongStream

public abstract LongStream asLongStream()

asDoubleStream

public abstract DoubleStream asDoubleStream()

boxed

public abstract Stream<Integer> boxed()

iterator

public abstract PrimitiveIterator.OfInt iterator()

empty

public static IntStream empty()

of

public static IntStream of(int value)

of

public static IntStream of(int... values)

iterate

public static IntStream iterate(int seed, IntUnaryOperator f)
seed, then f applied to it, then f applied to that, without end.

iterate

public static IntStream iterate(int seed, IntPredicate hasNext, IntUnaryOperator next)
As iterate(int, IntUnaryOperator), ending before the first value hasNext refuses.

generate

public static IntStream generate(IntSupplier s)
The values s answers, one call per element, without end.

range

public static IntStream range(int startInclusive, int endExclusive)
The values from startInclusive up to, not including, endExclusive, in steps of one. Empty when startInclusive is not below endExclusive.

rangeClosed

public static IntStream rangeClosed(int startInclusive, int endInclusive)
The values from startInclusive up to and including endInclusive, in steps of one. Empty when startInclusive is above endInclusive.

concat

public static IntStream concat(IntStream a, IntStream b)
The elements of a, then those of b. Closing the result closes both.