Class AbstractProgressReporter

java.lang.Object
ubic.gemma.core.util.AbstractProgressReporter
All Implemented Interfaces:
AutoCloseable, ProgressReporter
Direct Known Subclasses:
ConsoleProgressReporter, LoggingProgressReporter

public abstract class AbstractProgressReporter extends Object implements ProgressReporter
  • Constructor Details

    • AbstractProgressReporter

      public AbstractProgressReporter()
  • Method Details

    • setProgressIncrementToReportInPercent

      public void setProgressIncrementToReportInPercent(double progressIncrementToReportInPercent)
      Description copied from interface: ProgressReporter
      Set the minimum progress increment size to report in percentage.

      This is used if maxSizeInBytes is set.

      Specified by:
      setProgressIncrementToReportInPercent in interface ProgressReporter
    • setProgressIncrementToReportInBytes

      public void setProgressIncrementToReportInBytes(double progressIncrementToReportInBytes)
      Description copied from interface: ProgressReporter
      Set the minimum progress increment size to report in bytes.

      This is used if maxSizeInBytes is unknown.

      Specified by:
      setProgressIncrementToReportInBytes in interface ProgressReporter
    • reportProgress

      public void reportProgress(long progressInBytes, long maxSizeInBytes)
      Description copied from interface: ProgressReporter
      Report progress.

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

      Specified by:
      reportProgress in interface ProgressReporter
    • reportProgress

      public void reportProgress(long progressInBytes, long maxSizeInBytes, boolean atEnd)
      Description copied from interface: ProgressReporter
      Report progress.
      Specified by:
      reportProgress in interface ProgressReporter
      Parameters:
      progressInBytes - progress in bytes
      maxSizeInBytes - maximum size in bytes if known, else -1
      atEnd - indicate that this is the last progress report
    • doReportProgress

      protected abstract void doReportProgress(double progressInPercent, long progressInBytes, long maxSizeInBytes, boolean atEnd)
    • doReportUnknownProgress

      protected abstract void doReportUnknownProgress(long progressInBytes, boolean atEnd)