Class ProgressBar
java.lang.Object
com.helixframework.console.progress.ProgressBar
The ProgressBar class represents a customizable textual progress bar that can be used to visually
display the progress of a process or task.
The progress bar supports customization options such as the length of the bar, the characters used
to represent completed and incomplete portions, and an optional label. It can be updated dynamically
and display progress information in real time to the console.
Features:
- Adjustable bar length.
- Customizable characters for progress and empty spaces.
- Optional label and progress text.
- Real-time updates and resets.
Use the nested
Builder class to create and configure instances of ProgressBar.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for creating and configuring instances of ProgressBar. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProgressBar.Builderbuilder()Creates a new instance of the Builder class for configuring and constructing a ProgressBar instance.voidreset()Resets the progress bar to its initial state.toString()voidupdate(int progress) Updates the progress displayed by the progress bar to the specified value.voidUpdates the progress bar with the specified progress value and optional progress text.
-
Method Details
-
builder
Creates a new instance of the Builder class for configuring and constructing a ProgressBar instance.- Returns:
- a new Builder instance for creating a ProgressBar
-
update
public void update(int progress) Updates the progress displayed by the progress bar to the specified value.- Parameters:
progress- the new progress value, typically represented as a percentage between 0 and 100.
-
update
Updates the progress bar with the specified progress value and optional progress text.- Parameters:
progress- the new progress value, typically represented as a percentage between 0 and 100.progressText- the text to display alongside the progress value, or null if no text is desired.
-
reset
public void reset()Resets the progress bar to its initial state. Sets the progress value back to 0, effectively displaying an empty progress bar. -
toString
-