Package wsh.util
Class PartialMonitor
- java.lang.Object
-
- wsh.util.PartialMonitor
-
-
Field Summary
-
Fields inherited from interface wsh.util.Monitor
NULL_MONITOR
-
-
Constructor Summary
Constructors Constructor Description PartialMonitor(Monitor wrapped, double begin, double end)An existing Monitor will be wrapped for progress in a limited range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitReport(double initFraction)Initialize the fraction of the work that was completed when the process started.booleanisCanceled()If true, then any further progress should be cancelled.voidreport(double fraction)This method will be called with the current fraction of work done.
-
-
-
Constructor Detail
-
PartialMonitor
public PartialMonitor(Monitor wrapped, double begin, double end)
An existing Monitor will be wrapped for progress in a limited range.- Parameters:
wrapped- The wrapped monitor.begin- The first value to be updated to the wrapped monitor, corresponding to a 0 reported to this monitor.end- The last value to be updated to the wrapped monitor corresponding to a 1 reported to this monitor.
-
-
Method Detail
-
report
public void report(double fraction)
Description copied from interface:MonitorThis method will be called with the current fraction of work done. Values range from 0 at the beginning to 1 when all work is done.
-
isCanceled
public boolean isCanceled()
Description copied from interface:MonitorIf true, then any further progress should be cancelled.- Specified by:
isCanceledin interfaceMonitor- Returns:
- true, when any requested work should be interrupted. False, if progress is expected to run to completion.
-
initReport
public void initReport(double initFraction)
Description copied from interface:MonitorInitialize the fraction of the work that was completed when the process started. If not called, then assumed to be 0.- Specified by:
initReportin interfaceMonitor- Parameters:
initFraction- Fraction of work done when process started, from 0 to 1.
-
-