View Javadoc
1   /*
2    * Copyright (C) 2009, Alex Blewitt <alex.blewitt@gmail.com>
3    * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
4    * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
5    *
6    * This program and the accompanying materials are made available under the
7    * terms of the Eclipse Distribution License v. 1.0 which is available at
8    * https://www.eclipse.org/org/documents/edl-v10.php.
9    *
10   * SPDX-License-Identifier: BSD-3-Clause
11   */
12  
13  package org.eclipse.jgit.lib;
14  
15  /**
16   * A NullProgressMonitor does not report progress anywhere.
17   */
18  public class NullProgressMonitor implements ProgressMonitor {
19  	/** Immutable instance of a null progress monitor. */
20  	public static final NullProgressMonitor INSTANCE = new NullProgressMonitor();
21  
22  	private NullProgressMonitor() {
23  		// Do not let others instantiate
24  	}
25  
26  	/** {@inheritDoc} */
27  	@Override
28  	public void start(int totalTasks) {
29  		// Do not report.
30  	}
31  
32  	/** {@inheritDoc} */
33  	@Override
34  	public void beginTask(String title, int totalWork) {
35  		// Do not report.
36  	}
37  
38  	/** {@inheritDoc} */
39  	@Override
40  	public void update(int completed) {
41  		// Do not report.
42  	}
43  
44  	/** {@inheritDoc} */
45  	@Override
46  	public boolean isCancelled() {
47  		return false;
48  	}
49  
50  	/** {@inheritDoc} */
51  	@Override
52  	public void endTask() {
53  		// Do not report.
54  	}
55  }