Interface ProgressReporter

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractProgressReporter, ConsoleProgressReporter, LoggingProgressReporter

public interface ProgressReporter extends AutoCloseable
Report progress.
Author:
poirigui
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear any progress that was rendered.
    void
    reportProgress(long progressInBytes, long maxSizeInBytes)
    Report progress.
    void
    reportProgress(long progressInBytes, long maxSizeInBytes, boolean atEnd)
    Report progress.
    void
    setProgressIncrementToReportInBytes(double progressIncrementToReportInBytes)
    Set the minimum progress increment size to report in bytes.
    void
    setProgressIncrementToReportInPercent(double progressIncrementToReportInPercent)
    Set the minimum progress increment size to report in percentage.
  • Method Details

    • setProgressIncrementToReportInPercent

      void setProgressIncrementToReportInPercent(double progressIncrementToReportInPercent)
      Set the minimum progress increment size to report in percentage.

      This is used if maxSizeInBytes is set.

    • setProgressIncrementToReportInBytes

      void setProgressIncrementToReportInBytes(double progressIncrementToReportInBytes)
      Set the minimum progress increment size to report in bytes.

      This is used if maxSizeInBytes is unknown.

    • reportProgress

      void reportProgress(long progressInBytes, long maxSizeInBytes)
      Report progress.

      This method assumes that if progressInBytes and maxSizeInBytes are equal, this is the last report.

    • reportProgress

      void reportProgress(long progressInBytes, long maxSizeInBytes, boolean atEnd)
      Report progress.
      Parameters:
      progressInBytes - progress in bytes
      maxSizeInBytes - maximum size in bytes if known, else -1
      atEnd - indicate that this is the last progress report
    • close

      void close()
      Clear any progress that was rendered.
      Specified by:
      close in interface AutoCloseable