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 LongStream
A sequence of long 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
Inherited methods
From BaseStream
Method details
sequential
public abstract LongStream sequential()Declared again with this type, as the JDK does: a call compiled
against the JDK names
LongStream.sequential() answering LongStream,
and the method inherited from BaseStream answers its type
variable, which is another descriptor.parallel
public abstract LongStream parallel()Declared again with this type; see
sequential().filter
public abstract LongStream filter(LongPredicate predicate)map
public abstract LongStream map(LongUnaryOperator mapper)mapToObj
public abstract <U> Stream<U> mapToObj(LongFunction<? extends U> mapper)mapToInt
public abstract IntStream mapToInt(LongToIntFunction mapper)mapToDouble
public abstract DoubleStream mapToDouble(LongToDoubleFunction mapper)flatMap
public abstract LongStream flatMap(LongFunction<? extends LongStream> mapper)distinct
public abstract LongStream distinct()sorted
public abstract LongStream sorted()peek
public abstract LongStream peek(LongConsumer action)limit
public abstract LongStream limit(long maxSize)skip
public abstract LongStream skip(long n)takeWhile
public abstract LongStream takeWhile(LongPredicate predicate)dropWhile
public abstract LongStream dropWhile(LongPredicate predicate)forEach
public abstract void forEach(LongConsumer action)forEachOrdered
public abstract void forEachOrdered(LongConsumer action)toArray
public abstract long[] toArray()reduce
public abstract long reduce(long identity, LongBinaryOperator op)reduce
public abstract OptionalLong reduce(LongBinaryOperator op)collect
public abstract <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner)sum
public abstract long sum()min
public abstract OptionalLong min()max
public abstract OptionalLong max()count
public abstract long count()average
public abstract OptionalDouble average()summaryStatistics
public abstract LongSummaryStatistics summaryStatistics()anyMatch
public abstract boolean anyMatch(LongPredicate predicate)allMatch
public abstract boolean allMatch(LongPredicate predicate)noneMatch
public abstract boolean noneMatch(LongPredicate predicate)findFirst
public abstract OptionalLong findFirst()findAny
public abstract OptionalLong findAny()asDoubleStream
public abstract DoubleStream asDoubleStream()boxed
public abstract Stream<Long> boxed()iterator
public abstract PrimitiveIterator.OfLong iterator()empty
public static LongStream empty()of
public static LongStream of(long value)of
public static LongStream of(long... values)iterate
public static LongStream iterate(long seed, LongUnaryOperator f)seed, then f applied to it, then f applied to that, without end.iterate
public static LongStream iterate(long seed, LongPredicate hasNext, LongUnaryOperator next)As
iterate(long, LongUnaryOperator), ending before the first value
hasNext refuses.generate
public static LongStream generate(LongSupplier s)The values
s answers, one call per element, without end.range
public static LongStream range(long startInclusive, long endExclusive)The values from
startInclusive up to, not including, endExclusive,
in steps of one. Empty when startInclusive is not below endExclusive.rangeClosed
public static LongStream rangeClosed(long startInclusive, long endInclusive)The values from
startInclusive up to and including endInclusive, in
steps of one. Empty when startInclusive is above endInclusive.concat
public static LongStream concat(LongStream a, LongStream b)The elements of
a, then those of b. Closing the result closes both.