Package org.eclipse.jdt.core.compiler
Class CompilationProgress
java.lang.Object
org.eclipse.jdt.core.compiler.CompilationProgress
A compilation progress is used by the
BatchCompiler
to report progress during compilation.
It is also used to request cancellation of the compilation.
Clients of the BatchCompiler
should subclass this class, instantiate the subclass and pass this instance to
BatchCompiler.compile(String, java.io.PrintWriter, java.io.PrintWriter, CompilationProgress)
.
This class is intended to be instantiated and subclassed by clients.
- Since:
- 3.4
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
begin
(int remainingWork) Notifies that the compilation is beginning.abstract void
done()
Notifies that the work is done; that is, either the compilation is completed or a cancellation was requested.abstract boolean
Returns whether cancellation of the compilation has been requested.abstract void
setTaskName
(String name) Reports the name (or description) of the current task.abstract void
worked
(int workIncrement, int remainingWork) Notifies that a given amount of work of the compilation has been completed.
-
Constructor Details
-
CompilationProgress
public CompilationProgress()
-
-
Method Details
-
begin
public abstract void begin(int remainingWork) Notifies that the compilation is beginning. This is called exactly once per batch compilation. An estimated amount of remaining work is given. This amount will change as the compilation progresses. The new estimated amount of remaining work is reported usingworked(int, int)
.Clients should not call this method.
- Parameters:
remainingWork
- the estimated amount of remaining work.
-
done
public abstract void done()Notifies that the work is done; that is, either the compilation is completed or a cancellation was requested. This is called exactly once per batch compilation.Clients should not call this method.
-
isCanceled
public abstract boolean isCanceled()Returns whether cancellation of the compilation has been requested.- Returns:
true
if cancellation has been requested, andfalse
otherwise
-
setTaskName
Reports the name (or description) of the current task.Clients should not call this method.
- Parameters:
name
- the name (or description) of the current task
-
worked
public abstract void worked(int workIncrement, int remainingWork) Notifies that a given amount of work of the compilation has been completed. Note that this amount represents an installment, as opposed to a cumulative amount of work done to date. Also notifies an estimated amount of remaining work. Note that this amount of remaining work may be greater than the previous estimated amount as new compilation units are injected in the compile loop.Clients should not call this method.
- Parameters:
workIncrement
- a non-negative amount of work just completedremainingWork
- a non-negative amount of estimated remaining work
-