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.
map(Class, 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 TypeMethodDescription<E extends Exception>
booleanallMatch(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.allMatch(DoublePredicate).<E extends Exception>
booleananyMatch(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.anyMatch(DoublePredicate).boxed()<R, E extends Exception>
Rcollect(Class<E> exceptionClass, ExSupplier<R, ? extends E> supplier, ExObjDoubleConsumer<R, ? extends E> accumulator, ExBiConsumer<R, R, ? extends E> combiner) distinct()<E extends Exception>
ExDoubleStreamdropWhile(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.dropWhile(DoublePredicate).static ExDoubleStreamempty()Returns an empty instance.<E extends Exception>
ExDoubleStreamfilter(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.filter(DoublePredicate).filter(DoublePredicate predicate) <E extends Exception>
ExDoubleStreamflatMap(Class<E> exceptionClass, ExDoubleFunction<? extends DoubleStream, ? extends E> mapper) Equivalent ofDoubleStream.flatMap(DoubleFunction).flatMap(DoubleFunction<? extends DoubleStream> mapper) <E extends Exception>
voidforEach(Class<E> exceptionClass, ExDoubleConsumer<? extends E> action) Equivalent ofDoubleStream.forEach(DoubleConsumer).<E extends Exception>
voidforEachOrdered(Class<E> exceptionClass, ExDoubleConsumer<? extends E> action) Equivalent ofDoubleStream.forEachOrdered(DoubleConsumer).limit(long maxSize) <E extends Exception>
ExDoubleStreammap(Class<E> exceptionClass, ExDoubleUnaryOperator<? extends E> mapper) Equivalent ofDoubleStream.map(DoubleUnaryOperator).map(DoubleUnaryOperator mapper) <E extends Exception>
ExDoubleStreammapMulti(Class<E> exceptionClass, ExDoubleMapMultiConsumer<? extends E> mapper) Equivalent ofDoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer).<E extends Exception>
ExIntStreammapToInt(Class<E> exceptionClass, ExDoubleToIntFunction<? extends E> mapper) Equivalent ofDoubleStream.mapToInt(DoubleToIntFunction).mapToInt(DoubleToIntFunction mapper) <E extends Exception>
ExLongStreammapToLong(Class<E> exceptionClass, ExDoubleToLongFunction<? extends E> mapper) Equivalent ofDoubleStream.mapToLong(DoubleToLongFunction).mapToLong(DoubleToLongFunction mapper) mapToObj(Class<E> exceptionClass, ExDoubleFunction<? extends U, ? extends E> mapper) Equivalent ofDoubleStream.mapToObj(DoubleFunction).<U> ExStream<U> mapToObj(DoubleFunction<? extends U> mapper) <E extends Exception>
booleannoneMatch(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.noneMatch(DoublePredicate).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()<E extends Exception>
ExDoubleStreampeek(Class<E> exceptionClass, ExDoubleConsumer<? extends E> action) Equivalent ofDoubleStream.peek(DoubleConsumer).peek(DoubleConsumer action) <E extends Exception>
doublereduce(Class<E> exceptionClass, double identity, ExDoubleBinaryOperator<? extends E> op) Equivalent ofDoubleStream.reduce(double, DoubleBinaryOperator).<E extends Exception>
OptionalDoublereduce(Class<E> exceptionClass, ExDoubleBinaryOperator<? extends E> op) Equivalent ofDoubleStream.reduce(DoubleBinaryOperator).skip(long n) sorted()<E extends Exception>
ExDoubleStreamtakeWhile(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.takeWhile(DoublePredicate).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
-
filter
public <E extends Exception> ExDoubleStream filter(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) 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.
- Type Parameters:
E- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEpredicate- seeDoubleStream.filter(DoublePredicate)- Returns:
- see
DoubleStream.filter(DoublePredicate)
-
map
public <E extends Exception> ExDoubleStream map(Class<E> exceptionClass, ExDoubleUnaryOperator<? extends E> mapper) 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.
- Type Parameters:
E- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEmapper- seeDoubleStream.map(DoubleUnaryOperator)- Returns:
- see
DoubleStream.map(DoubleUnaryOperator)
-
mapToObj
public <U, E extends Exception> ExStream<U> mapToObj(Class<E> exceptionClass, ExDoubleFunction<? extends U, ? extends E> mapper) 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 streamE- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEmapper- seeDoubleStream.mapToObj(DoubleFunction)- Returns:
- see
DoubleStream.mapToObj(DoubleFunction)
-
mapToInt
public <E extends Exception> ExIntStream mapToInt(Class<E> exceptionClass, ExDoubleToIntFunction<? extends E> mapper) 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.
- Type Parameters:
E- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEmapper- seeDoubleStream.mapToInt(DoubleToIntFunction)- Returns:
- see
DoubleStream.mapToInt(DoubleToIntFunction)
-
mapToLong
public <E extends Exception> ExLongStream mapToLong(Class<E> exceptionClass, ExDoubleToLongFunction<? extends E> mapper) 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.
- Type Parameters:
E- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEmapper- seeDoubleStream.mapToLong(DoubleToLongFunction)- Returns:
- see
DoubleStream.mapToLong(DoubleToLongFunction)
-
flatMap
public <E extends Exception> ExDoubleStream flatMap(Class<E> exceptionClass, ExDoubleFunction<? extends DoubleStream, ? extends E> mapper) 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.
- Type Parameters:
E- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEmapper- seeDoubleStream.flatMap(DoubleFunction)- Returns:
- see
DoubleStream.flatMap(DoubleFunction)
-
mapMulti
public <E extends Exception> ExDoubleStream mapMulti(Class<E> exceptionClass, ExDoubleMapMultiConsumer<? extends E> mapper) 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.
- Type Parameters:
E- The exception type thrown bymapper- Parameters:
exceptionClass- The exception class forEmapper- seeDoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer)- Returns:
- see
DoubleStream.mapMulti(DoubleStream.DoubleMapMultiConsumer)
-
peek
public <E extends Exception> ExDoubleStream peek(Class<E> exceptionClass, ExDoubleConsumer<? extends E> action) Equivalent ofDoubleStream.peek(DoubleConsumer).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown byaction- Parameters:
exceptionClass- The exception class forEaction- seeDoubleStream.peek(DoubleConsumer)- Returns:
- see
DoubleStream.peek(DoubleConsumer)
-
takeWhile
public <E extends Exception> ExDoubleStream takeWhile(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.takeWhile(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown bypredicate- Parameters:
exceptionClass- The exception class forEpredicate- seeDoubleStream.takeWhile(DoublePredicate)- Returns:
- see
DoubleStream.takeWhile(DoublePredicate)
-
dropWhile
public <E extends Exception> ExDoubleStream dropWhile(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.dropWhile(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown bypredicate- Parameters:
exceptionClass- The exception class forEpredicate- seeDoubleStream.dropWhile(DoublePredicate)- Returns:
- see
DoubleStream.dropWhile(DoublePredicate)
-
forEach
public <E extends Exception> void forEach(Class<E> exceptionClass, ExDoubleConsumer<? extends E> action) Equivalent ofDoubleStream.forEach(DoubleConsumer).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown byaction- Parameters:
exceptionClass- The exception class forEaction- seeDoubleStream.forEach(DoubleConsumer)
-
forEachOrdered
public <E extends Exception> void forEachOrdered(Class<E> exceptionClass, ExDoubleConsumer<? extends E> action) Equivalent ofDoubleStream.forEachOrdered(DoubleConsumer).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown byaction- Parameters:
exceptionClass- The exception class forEaction- seeDoubleStream.forEachOrdered(DoubleConsumer)
-
reduce
public <E extends Exception> double reduce(Class<E> exceptionClass, double identity, ExDoubleBinaryOperator<? extends E> op) Equivalent ofDoubleStream.reduce(double, DoubleBinaryOperator).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown byop- Parameters:
exceptionClass- The exception class forEidentity- seeDoubleStream.reduce(double, DoubleBinaryOperator)op- seeDoubleStream.reduce(double, DoubleBinaryOperator)- Returns:
- see
DoubleStream.reduce(double, DoubleBinaryOperator)
-
reduce
public <E extends Exception> OptionalDouble reduce(Class<E> exceptionClass, ExDoubleBinaryOperator<? extends E> op) Equivalent ofDoubleStream.reduce(DoubleBinaryOperator).If
actionthrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown byop- Parameters:
exceptionClass- The exception class forEop- seeDoubleStream.reduce(DoubleBinaryOperator)- Returns:
- see
DoubleStream.reduce(DoubleBinaryOperator)
-
collect
public <R, E extends Exception> R collect(Class<E> exceptionClass, ExSupplier<R, ? extends E> supplier, ExObjDoubleConsumer<R, ? extends E> accumulator, ExBiConsumer<R, R, ? extends E> 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 containerE- The exception type thrown bysupplier,accumulatororcombiner- Parameters:
exceptionClass- The exception class forEsupplier- seeDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)accumulator- seeDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)combiner- seeDoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)- Returns:
- see
DoubleStream.collect(Supplier, ObjDoubleConsumer, BiConsumer)
-
anyMatch
public <E extends Exception> boolean anyMatch(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.anyMatch(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown bypredicate- Parameters:
exceptionClass- The exception class forEpredicate- seeDoubleStream.anyMatch(DoublePredicate)- Returns:
- see
DoubleStream.anyMatch(DoublePredicate)
-
allMatch
public <E extends Exception> boolean allMatch(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.allMatch(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown bypredicate- Parameters:
exceptionClass- The exception class forEpredicate- seeDoubleStream.allMatch(DoublePredicate)- Returns:
- see
DoubleStream.allMatch(DoublePredicate)
-
noneMatch
public <E extends Exception> boolean noneMatch(Class<E> exceptionClass, ExDoublePredicate<? extends E> predicate) Equivalent ofDoubleStream.noneMatch(DoublePredicate).If
predicatethrows a checked exception, aExExceptionwill be thrown instead. This will have the original exception as itscause.- Type Parameters:
E- The exception type thrown bypredicate- Parameters:
exceptionClass- The exception class forEpredicate- seeDoubleStream.noneMatch(DoublePredicate)- Returns:
- see
DoubleStream.noneMatch(DoublePredicate)
-