Top Description Fields Constructors Methods
org.eclipse.jgit.transport

public Class ProgressSpinner

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

A simple spinner connected to an OutputStream.

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

Field Summary

Modifier and TypeField and Description
private static final long
private String
private long
private final OutputStream
private boolean
private int
private static final char[]
private boolean

Constructor Summary

AccessConstructor and Description
public
ProgressSpinner(OutputStream
where to send output to.
out
)

Initialize a new spinner.

Method Summary

Modifier and TypeMethod and Description
public void
beginTask(String
description of the task, suitable for human viewing.
title
,
long
delay to wait before displaying anything at all.
delay
,
TimeUnit
unit for delay.
delayUnits
)

Begin a time consuming task.

public void
endTask(String
text to print after the task's title "$title ... $result".
result
)

Denote the current task completed.

private void
send(long now)

public void
update()

Update the spinner if it is showing.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MIN_REFRESH_MILLISback to summary
private static final long MIN_REFRESH_MILLIS
msgback to summary
private String msg
nextUpdateMillisback to summary
private long nextUpdateMillis
outback to summary
private final OutputStream out
shownback to summary
private boolean shown
stateback to summary
private int state
STATESback to summary
private static final char[] STATES
writeback to summary
private boolean write

Constructor Detail

ProgressSpinnerback to summary
public ProgressSpinner(OutputStream out)

Initialize a new spinner.

Parameters
out:OutputStream

where to send output to.

Method Detail

beginTaskback to summary
public void beginTask(String title, long delay, TimeUnit delayUnits)

Begin a time consuming task.

Parameters
title:String

description of the task, suitable for human viewing.

delay:long

delay to wait before displaying anything at all.

delayUnits:TimeUnit

unit for delay.

endTaskback to summary
public void endTask(String result)

Denote the current task completed.

Parameters
result:String

text to print after the task's title "$title ... $result".

sendback to summary
private void send(long now)
updateback to summary
public void update()

Update the spinner if it is showing.

writeback to summary
private void write(String s)