Class ExDoubleStream
- All Implemented Interfaces:
AutoCloseable, BaseStream<Double, DoubleStream>, DoubleStream
Implements versions of all methods from DoubleStream that use functional interfaces, using their counterparts with Exceptions instead, e.g.
exMap(ExDoubleUnaryOperator) in parallel to map(DoubleUnaryOperator).
If these functional interfaces throw a checked exception, a ExException will be thrown instead.
This will have the original exception as its cause.
Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream (except if it is itself such an operation).
-
Nested Class Summary
Nested classes/interfaces inherited from interface DoubleStream
DoubleStream.Builder, DoubleStream.DoubleMapMultiConsumer -
Method Summary
Modifier and TypeMethodDescriptionboxed()distinct()static ExDoubleStreamempty()Returns an empty instance.booleanexAllMatch(ExDoublePredicate<?> predicate) Equivalent ofDoubleStream.allMatch(DoublePredicate).booleanexAnyMatch(ExDoublePredicate<?> predicate) Equivalent ofDoubleStream.anyMatch(DoublePredicate).<R> RexCollect(ExSupplier<R, ?> supplier, ExObjDoubleConsumer<R, ?> accumulator, ExBiConsumer<R, R, ?> combiner) exDropWhile(ExDoublePredicate<?> predicate) Equivalent ofDoubleStream.dropWhile(DoublePredicate).exFilter(ExDoublePredicate<?> predicate) Equivalent ofDoubleStream.filter(DoublePredicate).exFlatMap(ExDoubleFunction<? extends DoubleStream, ?> mapper) Equivalent ofDoubleStream.flatMap(DoubleFunction).voidexForEach(ExDoubleConsumer<?> action) Equivalent ofDoubleStream.forEach(DoubleConsumer).voidexForEachOrdered(ExDoubleConsumer<?> action) Equivalent ofDoubleStream.forEachOrdered(DoubleConsumer).exMap(ExDoubleUnaryOperator<?> mapper) Equivalent ofDoubleStream.map(DoubleUnaryOperator).exMapMulti(ExDoubleMapMultiConsumer<?> mapper) Equivalent ofDoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer).exMapToInt(ExDoubleToIntFunction<?> mapper) Equivalent ofDoubleStream.mapToInt(DoubleToIntFunction).exMapToLong(ExDoubleToLongFunction<?> mapper) Equivalent ofDoubleStream.mapToLong(DoubleToLongFunction).<U> ExStream<U> exMapToObj(ExDoubleFunction<? extends U, ?> mapper) Equivalent ofDoubleStream.mapToObj(DoubleFunction).booleanexNoneMatch(ExDoublePredicate<?> predicate) Equivalent ofDoubleStream.noneMatch(DoublePredicate).exPeek(ExDoubleConsumer<?> action) Equivalent ofDoubleStream.peek(DoubleConsumer).exReduce(double identity, ExDoubleBinaryOperator<?> op) Equivalent ofDoubleStream.reduce(double, DoubleBinaryOperator).exReduce(ExDoubleBinaryOperator<?> op) Equivalent ofDoubleStream.reduce(DoubleBinaryOperator).exTakeWhile(ExDoublePredicate<?> predicate) Equivalent ofDoubleStream.takeWhile(DoublePredicate).filter(DoublePredicate predicate) flatMap(DoubleFunction<? extends DoubleStream> mapper) limit(long maxSize) map(DoubleUnaryOperator mapper) mapToInt(DoubleToIntFunction mapper) mapToLong(DoubleToLongFunction mapper) <U> ExStream<U> mapToObj(DoubleFunction<? extends U> mapper) static ExDoubleStreamof(double t) Returns an instance containing a single element.static ExDoubleStreamof(double... values) Returns an instance whose elements are the specified values.static ExDoubleStreamof(DoubleStream stream) Create an instance from an existingDoubleStream.parallel()peek(DoubleConsumer action) skip(long n) sorted()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BaseStream
close, isParallel
-
Method Details
-
of
Create an instance from an existingDoubleStream.- Parameters:
stream- existing stream- Returns:
- instance from an existing
DoubleStream
-
empty
-
of
Returns an instance containing a single element.- Parameters:
t- the single element- Returns:
- an instance containing a single element
-
of
Returns an instance whose elements are the specified values.- Parameters:
values- the elements of the new stream- Returns:
- the new stream
-
mapToObj
- Specified by:
mapToObjin interfaceDoubleStream
-
boxed
- Specified by:
boxedin interfaceDoubleStream
-
filter
- Specified by:
filterin interfaceDoubleStream
-
map
- Specified by:
mapin interfaceDoubleStream
-
flatMap
- Specified by:
flatMapin interfaceDoubleStream
-
distinct
- Specified by:
distinctin interfaceDoubleStream
-
sorted
- Specified by:
sortedin interfaceDoubleStream
-
peek
- Specified by:
peekin interfaceDoubleStream
-
limit
- Specified by:
limitin interfaceDoubleStream
-
skip
- Specified by:
skipin interfaceDoubleStream
-
sequential
- Specified by:
sequentialin interfaceBaseStream<Double, DoubleStream>- Specified by:
sequentialin interfaceDoubleStream
-
parallel
- Specified by:
parallelin interfaceBaseStream<Double, DoubleStream>- Specified by:
parallelin interfaceDoubleStream
-
unordered
- Specified by:
unorderedin interfaceBaseStream<Double, DoubleStream>
-
onClose
- Specified by:
onClosein interfaceBaseStream<Double, DoubleStream>
-
mapToInt
- Specified by:
mapToIntin interfaceDoubleStream
-
mapToLong
- Specified by:
mapToLongin interfaceDoubleStream
-
exFilter
Equivalent ofDoubleStream.filter(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Parameters:
predicate- seeDoubleStream.filter(DoublePredicate)- Returns:
- see
DoubleStream.filter(DoublePredicate)
-
exMap
Equivalent ofDoubleStream.map(DoubleUnaryOperator).If
mapperthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Parameters:
mapper- seeDoubleStream.map(DoubleUnaryOperator)- Returns:
- see
DoubleStream.map(DoubleUnaryOperator)
-
exMapToObj
Equivalent ofDoubleStream.mapToObj(DoubleFunction).If
mapperthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Type Parameters:
U- the element type of the new stream- Parameters:
mapper- seeDoubleStream.mapToObj(DoubleFunction)- Returns:
- see
DoubleStream.mapToObj(DoubleFunction)
-
exMapToInt
Equivalent ofDoubleStream.mapToInt(DoubleToIntFunction).If
mapperthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Parameters:
mapper- seeDoubleStream.mapToInt(DoubleToIntFunction)- Returns:
- see
DoubleStream.mapToInt(DoubleToIntFunction)
-
exMapToLong
Equivalent ofDoubleStream.mapToLong(DoubleToLongFunction).If
mapperthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Parameters:
mapper- seeDoubleStream.mapToLong(DoubleToLongFunction)- Returns:
- see
DoubleStream.mapToLong(DoubleToLongFunction)
-
exFlatMap
Equivalent ofDoubleStream.flatMap(DoubleFunction).If
mapperthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Parameters:
mapper- seeDoubleStream.flatMap(DoubleFunction)- Returns:
- see
DoubleStream.flatMap(DoubleFunction)
-
exMapMulti
Equivalent ofDoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer).If
mapperthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.Note that this exception will likely not be thrown when a method is called, but only when a terminal operation or a stateful intermediate operation is used on the stream.
- Parameters:
mapper- seeDoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer)- Returns:
- see
DoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer)
-
exPeek
Equivalent ofDoubleStream.peek(DoubleConsumer).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
action- seeDoubleStream.peek(DoubleConsumer)- Returns:
- see
DoubleStream.peek(DoubleConsumer)
-
exTakeWhile
Equivalent ofDoubleStream.takeWhile(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
predicate- seeDoubleStream.takeWhile(DoublePredicate)- Returns:
- see
DoubleStream.takeWhile(DoublePredicate)
-
exDropWhile
Equivalent ofDoubleStream.dropWhile(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
predicate- seeDoubleStream.dropWhile(DoublePredicate)- Returns:
- see
DoubleStream.dropWhile(DoublePredicate)
-
exForEach
Equivalent ofDoubleStream.forEach(DoubleConsumer).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
action- seeDoubleStream.forEach(DoubleConsumer)
-
exForEachOrdered
Equivalent ofDoubleStream.forEachOrdered(DoubleConsumer).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
action- seeDoubleStream.forEachOrdered(DoubleConsumer)
-
exReduce
Equivalent ofDoubleStream.reduce(double, DoubleBinaryOperator).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
identity- seeDoubleStream.reduce(double, DoubleBinaryOperator)op- seeDoubleStream.reduce(double, DoubleBinaryOperator)- Returns:
- see
DoubleStream.reduce(double, DoubleBinaryOperator)
-
exReduce
Equivalent ofDoubleStream.reduce(DoubleBinaryOperator).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
op- seeDoubleStream.reduce(DoubleBinaryOperator)- Returns:
- see
DoubleStream.reduce(DoubleBinaryOperator)
-
exCollect
public <R> R exCollect(ExSupplier<R, ?> supplier, ExObjDoubleConsumer<R, ?> accumulator, ExBiConsumer<R, R, ?> combiner) Equivalent ofDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer).If
supplier,accumulatororcombinerthrow a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
R- the type of the mutable result container- Parameters:
supplier- seeDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)accumulator- seeDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)combiner- seeDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)- Returns:
- see
DoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)
-
exAnyMatch
Equivalent ofDoubleStream.anyMatch(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
predicate- seeDoubleStream.anyMatch(DoublePredicate)- Returns:
- see
DoubleStream.anyMatch(DoublePredicate)
-
exAllMatch
Equivalent ofDoubleStream.allMatch(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
predicate- seeDoubleStream.allMatch(DoublePredicate)- Returns:
- see
DoubleStream.allMatch(DoublePredicate)
-
exNoneMatch
Equivalent ofDoubleStream.noneMatch(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Parameters:
predicate- seeDoubleStream.noneMatch(DoublePredicate)- Returns:
- see
DoubleStream.noneMatch(DoublePredicate)
-