- java.lang.Object
-
- org.eclipse.jgit.transport.ProgressSpinner
-
public class ProgressSpinner extends Object
A simple spinner connected to anOutputStream.This is class is not thread-safe. The update method may only be used from a single thread. Updates are sent only as frequently as
update()is invoked by the caller, and are capped at no more than 2 times per second by requiring at least 500 milliseconds between updates.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description ProgressSpinner(OutputStream out)Initialize a new spinner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginTask(String title, long delay, TimeUnit delayUnits)Begin a time consuming task.voidendTask(String result)Denote the current task completed.voidupdate()Update the spinner if it is showing.
-
-
-
Constructor Detail
-
ProgressSpinner
public ProgressSpinner(OutputStream out)
Initialize a new spinner.- Parameters:
out- where to send output to.
-
-
Method Detail
-
beginTask
public void beginTask(String title, long delay, TimeUnit delayUnits)
Begin a time consuming task.- Parameters:
title- description of the task, suitable for human viewing.delay- delay to wait before displaying anything at all.delayUnits- unit fordelay.
-
update
public void update()
Update the spinner if it is showing.
-
endTask
public void endTask(String result)
Denote the current task completed.- Parameters:
result- text to print after the task's title"$title ... $result".
-
-