public class TimeLimitedProgressUpdater extends DefaultProgressUpdater
DefaultProgressUpdater
. It prints the
percentage of iterations that is already done on the screen. Furthermore it
limits the time of the progress. If a progress calls the method
isCancelled()
and the time given in the constructor has passed
false
is returned. Be aware: this class does not stop a progress
after a certain time, it only answers on request. The user has to stop the
progress!max
Constructor and Description |
---|
TimeLimitedProgressUpdater(Time t,
int sec,
int min,
int hours,
int days)
Creates a new
TimeLimitedProgressUpdater . |
Modifier and Type | Method and Description |
---|---|
boolean |
isCancelled()
Specifies if the process is cancelled by the user.
|
void |
setValue(int value)
Sets the current value the supervised process has reached.
|
String |
toString() |
setMax
public TimeLimitedProgressUpdater(Time t, int sec, int min, int hours, int days) throws IllegalArgumentException
TimeLimitedProgressUpdater
.t
- the current used timesec
- secondsmin
- minuteshours
- hoursdays
- daysIllegalArgumentException
- if one of sec
, min
,
hours
or days
is less than 0Time
,
RealTime
,
UserTime
public void setValue(int value)
ProgressUpdater
setValue
in interface ProgressUpdater
setValue
in class DefaultProgressUpdater
value
- the current valuepublic boolean isCancelled()
ProgressUpdater
isCancelled
in interface ProgressUpdater
isCancelled
in class DefaultProgressUpdater
true
if process was cancelled, false
otherwise