code: private void printProgressBar() {
  
      double x;
  
      this.out.print("\r");
      this.out.print(PROGRESS_BAR_END_CHAR);
  
      for (int i = 1; i <= this.length; i++) {
  
        if (!Double.isNaN(this.progress)) {
  
          x = (double) i / this.length;
          this.out.print(this.progress >= x ? PROGRESS_BAR_CHAR : PROGRESS_BACKGROUND_CHAR);
  
        } else { // Double.isNaN(progress)
  
          this.out.print(PROGRESS_BAR_INDETERMINANT_CHAR);
  
        }
  
      }
  
      this.out.print(PROGRESS_BAR_END_CHAR);
  
      if (this.maximum > 0) {
        this.out.printf(" (%d/%d)", value, maximum);
      }
  
      this.out.print(" ");
      this.out.print(status);
  
    }
docs: Writes the progress bar to the stream.
  @param progress