com.lgc.wsh.util
Class PartialMonitor

java.lang.Object
  extended by com.lgc.wsh.util.PartialMonitor
All Implemented Interfaces:
Monitor

public class PartialMonitor
extends java.lang.Object
implements Monitor

Wrap an existing Monitor with a partial range. Note that only makes sense to call initReport() with the first wrapper used.


Field Summary
 
Fields inherited from interface com.lgc.wsh.util.Monitor
NULL_MONITOR
 
Constructor Summary
PartialMonitor(Monitor wrapped, double begin, double end)
          An existing Monitor will be wrapped for progress in a limited range.
 
Method Summary
 void initReport(double initFraction)
          Initialize the fraction of the work that was completed when the process started.
 void report(double fraction)
          This method will be called with the current fraction of work done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: Monitor
This 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.

Specified by:
report in interface Monitor
Parameters:
fraction - Fraction of work done so far, from 0 to 1. This value must equal or exceed all values previously passed to this method or to initReport.

initReport

public void initReport(double initFraction)
Description copied from interface: Monitor
Initialize the fraction of the work that was completed when the process started. If not called, then assumed to be 0.

Specified by:
initReport in interface Monitor
Parameters:
initFraction - Fraction of work done when process started, from 0 to 1.