java.lang.Object
java.lang.Thread
imagingbook.common.util.progress.ProgressMonitor
imagingbook.common.util.progress.ConsoleProgressMonitor
- All Implemented Interfaces:
AutoCloseable,Runnable
A simple progress monitor that only prints the progress of the monitored target task to the console. See
ProgressMonitorExample for a usage example.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class imagingbook.common.util.progress.ProgressMonitor
DefaultWaitTimeFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidhandleProgress(double progress, long elapsedNanoTime) Called periodically by theProgressMonitorthread supplying the current progress value (degree of completion).Methods inherited from class imagingbook.common.util.progress.ProgressMonitor
getElapsedTime, run, setWaitTimeMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
ConsoleProgressMonitor
Constructor.- Parameters:
target- the task (ProgressReporter) to be monitored
-
-
Method Details
-
handleProgress
Description copied from class:ProgressMonitorCalled periodically by theProgressMonitorthread supplying the current progress value (degree of completion). It is up to the implementation what action should be performed, e.g., display the current progress graphically (see e.g.IjProgressBarMonitor).- Specified by:
handleProgressin classProgressMonitor- Parameters:
progress- the current progress value (degree of completion) in [0,1)elapsedNanoTime- the time elapsed since this progress monitor was started (in nanoseconds)
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classProgressMonitor
-