Package com.deltawalker.script
Interface ProgressListener
- All Known Subinterfaces:
SyncProgressListener
public interface ProgressListener
Receives progress notifications from a long-running job, such as a merge,
and lets the caller cancel it. Optional wherever it is accepted; pass
null when progress is not of interest.- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoiddone()Notifies that the work is done: the job has completed or was canceled.booleanAnswers whether the job should be canceled.voidNotifies that a subtask of the job is beginning.voidworked(int work) Notifies that a number of units of work have been completed.
-
Method Details
-
done
void done()Notifies that the work is done: the job has completed or was canceled. This method may be called more than once.- Since:
- 2.0
-
isCanceled
boolean isCanceled()Answers whether the job should be canceled. Long-running jobs call this method periodically and stop when it returnstrue.- Returns:
trueto request cancellation,falseotherwise- Since:
- 2.0
-
subTask
Notifies that a subtask of the job is beginning. Not every job has subtasks; when copying several files, for instance, copying each file can be a subtask.- Parameters:
name- the name (or description) of the subtask- Since:
- 2.0
-
worked
void worked(int work) Notifies that a number of units of work have been completed. The number is an increment, not the total amount of work done so far.- Parameters:
work- a non-negative number of work units just completed- Since:
- 2.0
-