|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.expasy.jpl.commons.base.task.TerminalProgressBar
public final class TerminalProgressBar
A simple terminal progress bar.
A progress bar typically communicates the progress of some work by displaying its percentage of completion and possibly a textual display of this percentage.
A progression bar has 2 modes of execution. Depending on the a priori knowledge of the total steps, we have a Determinate mode or an Indeterminate mode.
The terminal progression bar is constituted of 2 parts:
LM PB
< -- >< -------- >
0 [===== ]
1 [ ===== ]
2 [ ===== ]
3 [ ===== ]
4 [ ===== ]
5 [ =====]
6 [ ===== ]
7 [ ===== ]
...
LM PB < -- >< -------- > 0/10 [ ] 1/10 [= ] 2/10 [== ] 3/10 [=== ] 4/10 [==== ] 5/10 [===== ] 6/10 [====== ] 7/10 [======= ] 8/10 [======== ] 9/10 [========= ] 10/10 [==========]
| Method Summary | |
|---|---|
static TerminalProgressBar |
indeterminate()
|
boolean |
isIndeterminate()
Return true if indeterminate |
static TerminalProgressBar |
newInstance(int minimum,
int maximum)
|
void |
setBarLength(int length)
Set the progress bar length. |
void |
setDoneMessage(String message)
|
void |
setIncompleteMessage(String message)
|
void |
setIndeterminate(boolean bool)
Sets the indeterminate property of the progress bar which determines whether the progress bar is in determinate or indeterminate mode. |
void |
setLeftMarginLength(int length)
Set the left margin length (with completion infos). |
void |
setMaximum(int maximum)
Sets the progress bar's minimum value to n |
void |
setMinimum(int minimum)
Sets the progress bar's maximum value to n |
void |
setPrintStream(PrintStream ps)
Set the print stream for bar display. |
void |
setRefreshBarPeriod(int period)
Set the period of bar animation refresh while the bar is in indeterminate mode. |
void |
setSegmentLength(int length)
Set the length of segment constantly animated in indeterminate mode. |
void |
setTaskName(String name)
Set the task name (displayed in left margin) |
void |
setValue(int completed)
Sets the progress bar's current value to n |
void |
start()
Initialize progress bar (mandatory to restart bar in Indeterminate mode) |
void |
stop()
Interrupt the task (mandatory to complete Inderminate mode) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TerminalProgressBar newInstance(int minimum,
int maximum)
public static TerminalProgressBar indeterminate()
public void setTaskName(String name)
ProgressBar
setTaskName in interface ProgressBarpublic void setLeftMarginLength(int length)
length - the left margin length.public void setBarLength(int length)
length - the given length.public void setRefreshBarPeriod(int period)
period - the period of refresh for cursor animation.public void setSegmentLength(int length)
length - the given length (> 0 and < bar len).public void setPrintStream(PrintStream ps)
ps - the output stream.public final void setMinimum(int minimum)
ProgressBar
setMinimum in interface ProgressBarpublic final void setMaximum(int maximum)
ProgressBar
setMaximum in interface ProgressBarpublic void setDoneMessage(String message)
public void setIncompleteMessage(String message)
public void setIndeterminate(boolean bool)
ProgressBar
setIndeterminate in interface ProgressBarpublic void start()
public void stop()
public void setValue(int completed)
ProgressBar
setValue in interface ProgressBarpublic final boolean isIndeterminate()
ProgressBar
isIndeterminate in interface ProgressBar
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||