Class StreamContext
java.lang.Object
one.util.streamex.StreamContext
This class controls stream execution mode (parallel/sequential), custom FJP
and close handlers.
Fields are package-private and mutable, but it's forbidden to change them from outside this class.
For performance reasons shared objects SEQUENTIAL and PARALLEL are used: then have no custom FJP and no close handler. If custom FJP or close handler is requested for shared object, a new object is created, otherwise the current one is modified.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Runnable(package private) ForkJoinPool(package private) boolean(package private) static final StreamContext(package private) static final StreamContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidclose()(package private) StreamContextcombine(BaseStream<?, ?> other) (package private) static Runnable(package private) StreamContextdetach()(package private) static StreamContextof(BaseStream<?, ?> stream) (package private) StreamContext(package private) StreamContextparallel()(package private) StreamContextparallel(ForkJoinPool fjp) (package private) StreamContext(package private) <T> T(package private) <T,U> T
-
Field Details
-
SEQUENTIAL
-
PARALLEL
-
parallel
boolean parallel -
fjp
ForkJoinPool fjp -
closeHandler
Runnable closeHandler
-
-
Constructor Details
-
StreamContext
private StreamContext(boolean parallel)
-
-
Method Details
-
terminate
-
terminate
-
parallel
StreamContext parallel() -
sequential
StreamContext sequential() -
parallel
-
detach
StreamContext detach() -
onClose
-
close
void close() -
compose
-
combine
-
of
-