NULL_MONITOR
Constructor and Description |
---|
LogMonitor(java.lang.String prefix,
java.util.logging.Logger logger)
Progress will be reported to this Logger.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Interrupt any further work.
|
static java.lang.String |
getProgressReport(long startTime,
long currentTime,
double fraction,
double initFraction)
Get a user-viewable String describing the progress
and completion time.
|
void |
initReport(double initFraction)
Initialize the fraction of the work that was
completed when the process started.
|
boolean |
isCanceled()
If true, then any further progress should be cancelled.
|
static void |
main(java.lang.String[] argv)
run tests
|
void |
report(double fraction)
This method will be called with the current fraction
of work done.
|
public LogMonitor(java.lang.String prefix, java.util.logging.Logger logger)
prefix
- Prefix this string to every report.logger
- Send to this Logger. If null,
then check arguments but do nothing.public void initReport(double initFraction)
Monitor
initReport
in interface Monitor
initFraction
- Fraction of work done when
process started, from 0 to 1.public void report(double fraction)
Monitor
public boolean isCanceled()
Monitor
isCanceled
in interface Monitor
public void cancel()
public static java.lang.String getProgressReport(long startTime, long currentTime, double fraction, double initFraction)
startTime
- Time in milliseconds when work began.currentTime
- Current time in milliseconds.fraction
- Current fraction of total progress, between 0 and 1.initFraction
- Initial fraction of total progress, between 0 and 1,
when work started.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- command linejava.lang.Exception
- test failures