ctongfei / progressbar

Terminal-based progress bar for Java / JVM
http://tongfei.me/progressbar/
MIT License
1.07k stars 102 forks source link

Know if progress bar have max value or it is set to infinity? #140

Closed lt3stus3el closed 1 year ago

lt3stus3el commented 2 years ago

Hi. I created a progress bar with max of -1. Everything is OK, but when I want check if progress bar has infinity max (or -1) it returns current value (not -1) of the progress bar.

I saw that in ProgressState there is a constant named indefinite and it is set when the initmax is -1:

if (initialMax < 0) indefinite = true;

I want to ask if it is possible to have access to ProgressState() or indefinite from ProgressBar object? Something like: boolean isIndefinite()?

ctongfei commented 1 year ago

@lt3stus3el thanks. I'll add this method to the ProgressBar object in the next version.