Package se.datadosen.jalbum.io
Class FileTreeProcessor
java.lang.Object
se.datadosen.jalbum.io.FileTreeProcessor
- All Implemented Interfaces:
AutoCloseable
Front end for ForkJoinPool capable of processing parallel Streams from
FileTreeCollection. To ensure that embedded ForkJoinPool is shut down, follow
these rules: 1) Always call process within try-with-arguments block (this
class is Autocloseable) 2) Ensure that stream processing throws
OperationAbortedException or InterruptedException if Thread.interrupted() is
true
- Since:
- 26.1
-
Constructor Summary
ConstructorDescriptionFileTreeProcessor
(File[] files, FileFilter filter) FileTreeProcessor
(FileTreeCollection collection) FileTreeProcessor
(FileTreeCollection collection, int nThreads) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
Mainly here to demo the strength of the process callboolean
<R> R
Clever stream processing that uses a parallel stream that uses its own auto-closing pool of 8 threads (per default)void
-
Constructor Details
-
FileTreeProcessor
-
FileTreeProcessor
-
FileTreeProcessor
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
shutdownNow
public void shutdownNow() -
isShutdown
public boolean isShutdown() -
process
Clever stream processing that uses a parallel stream that uses its own auto-closing pool of 8 threads (per default)- Type Parameters:
R
-- Parameters:
func
-- Returns:
- Throws:
IOException
OperationAbortedException
-
getTotalByteSize
Mainly here to demo the strength of the process call- Returns:
- Throws:
IOException
OperationAbortedException
-