public interface LongCacheStream extends LongStream
LongStream
that has additional methods to allow for Serializable instances. Please see
CacheStream
for additional details about various methods.LongStream.Builder
allMatch, anyMatch, average, builder, collect, concat, count, empty, findAny, findFirst, forEach, forEachOrdered, generate, iterate, iterator, max, min, noneMatch, of, of, range, rangeClosed, reduce, reduce, spliterator, sum, summaryStatistics, toArray
close, isParallel
LongCacheStream filter(LongPredicate predicate)
filter
in interface LongStream
LongCacheStream filter(SerializableLongPredicate predicate)
filter(LongPredicate)
except that the LongPredicate must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
predicate
- a non-interfering, stateless
predicate to apply to each element to determine if it
should be includedLongCacheStream map(LongUnaryOperator mapper)
map
in interface LongStream
LongCacheStream map(SerializableLongUnaryOperator mapper)
map(LongUnaryOperator)
except that the LongUnaryOperator must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
mapper
- a non-interfering, stateless
function to apply to each element<U> CacheStream<U> mapToObj(LongFunction<? extends U> mapper)
mapToObj
in interface LongStream
<U> CacheStream<U> mapToObj(SerializableLongFunction<? extends U> mapper)
mapToObj(LongFunction)
except that the LongFunction must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
U
- the element type of the new streammapper
- a non-interfering, stateless
function to apply to each elementIntCacheStream mapToInt(LongToIntFunction mapper)
mapToInt
in interface LongStream
IntCacheStream mapToInt(SerializableLongToIntFunction mapper)
mapToInt(LongToIntFunction)
except that the LongToIntFunction must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
mapper
- a non-interfering, stateless
function to apply to each elementDoubleCacheStream mapToDouble(LongToDoubleFunction mapper)
mapToDouble
in interface LongStream
DoubleCacheStream mapToDouble(SerializableLongToDoubleFunction mapper)
mapToDouble(LongToDoubleFunction)
except that the LongToLongFunction must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
mapper
- a non-interfering, stateless
function to apply to each elementLongCacheStream flatMap(LongFunction<? extends LongStream> mapper)
flatMap
in interface LongStream
LongCacheStream flatMap(SerializableLongFunction<? extends LongStream> mapper)
flatMap(LongFunction)
except that the LongFunction must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
mapper
- a non-interfering, stateless
function to apply to each element which produces a
LongStream
of new valuesLongCacheStream distinct()
distinct
in interface LongStream
LongCacheStream sorted()
sorted
in interface LongStream
LongCacheStream peek(LongConsumer action)
peek
in interface LongStream
LongCacheStream peek(SerializableLongConsumer action)
flatMap(LongFunction)
except that the LongFunction must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
action
- a non-interfering action to perform on the elements as
they are consumed from the streamLongCacheStream limit(long maxSize)
limit
in interface LongStream
LongCacheStream skip(long n)
skip
in interface LongStream
void forEach(SerializableLongConsumer action)
LongStream.forEach(LongConsumer)
except that the LongConsumer must also
implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
action
- a non-interfering action to perform on the elements<K,V> void forEach(ObjLongConsumer<Cache<K,V>> action)
LongStream.forEach(LongConsumer)
except that it takes an ObjLongConsumer
that
provides access to the underlying Cache
that is backing this stream.
Note that the CacheAware
interface is not supported for injection using this method as the cache
is provided in the consumer directly.
K
- key type of the cacheV
- value type of the cacheaction
- consumer to be ran for each element in the stream<K,V> void forEach(SerializableObjLongConsumer<Cache<K,V>> action)
K
- key type of the cacheV
- value type of the cacheaction
- consumer to be ran for each element in the streamlong reduce(long identity, SerializableLongBinaryOperator op)
LongStream.reduce(long, LongBinaryOperator)
except that the LongBinaryOperator must
also implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
identity
- the identity value for the accumulating functionop
- an associative, non-interfering, stateless
function for combining two valuesOptionalLong reduce(SerializableLongBinaryOperator op)
LongStream.reduce(LongBinaryOperator)
except that the LongBinaryOperator must
also implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
op
- an associative, non-interfering, stateless
function for combining two values<R> R collect(SerializableSupplier<R> supplier, SerializableObjLongConsumer<R> accumulator, SerializableBiConsumer<R,R> combiner)
LongStream.collect(Supplier, ObjLongConsumer, BiConsumer)
except that the arguments must
also implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
R
- type of the resultsupplier
- a function that creates a new result container. For a
parallel execution, this function may be called
multiple times and must return a fresh value each time.accumulator
- an associative, non-interfering, stateless
function for incorporating an additional element into a resultcombiner
- an associative, non-interfering, stateless
function for combining two values, which must be
compatible with the accumulator functionboolean anyMatch(SerializableLongPredicate predicate)
LongStream.anyMatch(LongPredicate)
except that the LongPredicate must
also implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
predicate
- a non-interfering, stateless
predicate to apply to elements of this streamtrue
if any elements of the stream match the provided
predicate, otherwise false
boolean allMatch(SerializableLongPredicate predicate)
LongStream.allMatch(LongPredicate)
except that the LongPredicate must
also implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
predicate
- a non-interfering, stateless
predicate to apply to elements of this streamtrue
if either all elements of the stream match the
provided predicate or the stream is empty, otherwise false
boolean noneMatch(SerializableLongPredicate predicate)
LongStream.noneMatch(LongPredicate)
except that the LongPredicate must
also implement Serializable.
This method will be used automatically by lambdas, which prevents users from having to manually cast to a Serializable lambda.
predicate
- a non-interfering, stateless
predicate to apply to elements of this streamtrue
if either no elements of the stream match the
provided predicate or the stream is empty, otherwise false
CacheStream<Long> boxed()
boxed
in interface LongStream
DoubleCacheStream asDoubleStream()
asDoubleStream
in interface LongStream
LongCacheStream sequential()
sequential
in interface BaseStream<Long,LongStream>
sequential
in interface LongStream
LongCacheStream parallel()
parallel
in interface BaseStream<Long,LongStream>
parallel
in interface LongStream
LongCacheStream unordered()
unordered
in interface BaseStream<Long,LongStream>
LongCacheStream onClose(Runnable closeHandler)
onClose
in interface BaseStream<Long,LongStream>
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.