Package com.bc.ceres.core
Class NullProgressMonitor
- java.lang.Object
-
- com.bc.ceres.core.NullProgressMonitor
-
- All Implemented Interfaces:
ProgressMonitor
public class NullProgressMonitor extends Object implements ProgressMonitor
A default progress monitor implementation suitable for subclassing.This implementation supports cancellation. The default implementations of the other methods do nothing.
This class has been more or less directly taken over from the Eclipse Core API.
-
-
Field Summary
-
Fields inherited from interface com.bc.ceres.core.ProgressMonitor
NULL, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description NullProgressMonitor()
Constructs a new progress monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTask(String taskName, int totalWork)
This implementation does nothing.void
done()
This implementation does nothing.void
internalWorked(double work)
This implementation does nothing.boolean
isCanceled()
This implementation returns the value of the internal state variable set bysetCanceled
.void
setCanceled(boolean canceled)
This implementation sets the value of an internal state variable.void
setSubTaskName(String subTaskName)
This implementation does nothing.void
setTaskName(String taskName)
This implementation does nothing.void
worked(int work)
This implementation does nothing.
-
-
-
Method Detail
-
beginTask
public void beginTask(String taskName, int totalWork)
This implementation does nothing. Subclasses may override this method to do interesting processing when a task begins.- Specified by:
beginTask
in interfaceProgressMonitor
- Parameters:
taskName
- the name (or description) of the main tasktotalWork
- the total number of work units into which the main task is been subdivided. If the value isUNKNOWN
the implementation is free to indicate progress in a way which doesn't require the total number of work units in advance.
-
done
public void done()
This implementation does nothing. Subclasses may override this method to do interesting processing when a task is done.- Specified by:
done
in interfaceProgressMonitor
-
internalWorked
public void internalWorked(double work)
This implementation does nothing. Subclasses may override this method.- Specified by:
internalWorked
in interfaceProgressMonitor
- Parameters:
work
- the amount of work done
-
isCanceled
public boolean isCanceled()
This implementation returns the value of the internal state variable set bysetCanceled
. Subclasses which override this method should overridesetCanceled
as well.- Specified by:
isCanceled
in interfaceProgressMonitor
- Returns:
true
if cancellation has been requested, andfalse
otherwise- See Also:
ProgressMonitor.setCanceled(boolean)
-
setCanceled
public void setCanceled(boolean canceled)
This implementation sets the value of an internal state variable. Subclasses which override this method should overrideisCanceled
as well.- Specified by:
setCanceled
in interfaceProgressMonitor
- Parameters:
canceled
-true
indicates that cancelation has been requested (but not necessarily acknowledged);false
clears this flag- See Also:
ProgressMonitor.isCanceled()
-
setTaskName
public void setTaskName(String taskName)
This implementation does nothing. Subclasses may override this method to do something with the name of the task.- Specified by:
setTaskName
in interfaceProgressMonitor
- Parameters:
taskName
- the name (or description) of the main task- See Also:
ProgressMonitor.beginTask(String, int)
-
setSubTaskName
public void setSubTaskName(String subTaskName)
This implementation does nothing. Subclasses may override this method to do interesting processing when a subtask begins.- Specified by:
setSubTaskName
in interfaceProgressMonitor
- Parameters:
subTaskName
- the name (or description) of the subtask
-
worked
public void worked(int work)
This implementation does nothing. Subclasses may override this method to do interesting processing when some work has been completed.- Specified by:
worked
in interfaceProgressMonitor
- Parameters:
work
- the number of work units just completed
-
-