Package org.eclipse.jgit.lib
Class NullProgressMonitor
- java.lang.Object
-
- org.eclipse.jgit.lib.NullProgressMonitor
-
- All Implemented Interfaces:
ProgressMonitor
public class NullProgressMonitor extends Object implements ProgressMonitor
A NullProgressMonitor does not report progress anywhere.
-
-
Field Summary
Fields Modifier and Type Field Description static NullProgressMonitor
INSTANCE
Immutable instance of a null progress monitor.-
Fields inherited from interface org.eclipse.jgit.lib.ProgressMonitor
UNKNOWN
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTask(String title, int totalWork)
Begin processing a single task.void
endTask()
Finish the current task, so the next can begin.boolean
isCancelled()
Check for user task cancellation.void
start(int totalTasks)
Advise the monitor of the total number of subtasks.void
update(int completed)
Denote that some work units have been completed.
-
-
-
Field Detail
-
INSTANCE
public static final NullProgressMonitor INSTANCE
Immutable instance of a null progress monitor.
-
-
Method Detail
-
start
public void start(int totalTasks)
Advise the monitor of the total number of subtasks.This should be invoked at most once per progress monitor interface.
- Specified by:
start
in interfaceProgressMonitor
- Parameters:
totalTasks
- the total number of tasks the caller will need to complete their processing.
-
beginTask
public void beginTask(String title, int totalWork)
Begin processing a single task.- Specified by:
beginTask
in interfaceProgressMonitor
- Parameters:
title
- title to describe the task. Callers should publish these as stable string constants that implementations could match against for translation support.totalWork
- total number of work units the application will perform;ProgressMonitor.UNKNOWN
if it cannot be predicted in advance.
-
update
public void update(int completed)
Denote that some work units have been completed.This is an incremental update; if invoked once per work unit the correct value for our argument is
1
, to indicate a single unit of work has been finished by the caller.- Specified by:
update
in interfaceProgressMonitor
- Parameters:
completed
- the number of work units completed since the last call.
-
isCancelled
public boolean isCancelled()
Check for user task cancellation.- Specified by:
isCancelled
in interfaceProgressMonitor
- Returns:
- true if the user asked the process to stop working.
-
endTask
public void endTask()
Finish the current task, so the next can begin.- Specified by:
endTask
in interfaceProgressMonitor
-
-