Class CompilationProgress

java.lang.Object
org.eclipse.jdt.core.compiler.CompilationProgress

public abstract class CompilationProgress extends Object
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    begin(int remainingWork)
    Notifies that the compilation is beginning.
    abstract void
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 using worked(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, and false otherwise
    • setTaskName

      public abstract void setTaskName(String name)
      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 completed
      remainingWork - a non-negative amount of estimated remaining work