Class ProgressTracker

java.lang.Object
uk.ac.starlink.table.join.ProgressTracker
All Implemented Interfaces:
AutoCloseable

public class ProgressTracker extends Object implements AutoCloseable
Wraps a ProgressIndicator for sequential usage. This takes care of messaging a progress indicator periodically given that the number of iterations is known up front.

This object should not be used from multiple threads concurrently.

Since:
21 Sep 2022
Author:
Mark Taylor
  • Constructor Details

    • ProgressTracker

      public ProgressTracker(ProgressIndicator progger, long count, String txt)
      Constructor.
      Parameters:
      progger - progress indicator
      count - number of invocations of progressNext expected
      txt - stage title to pass to indicator
  • Method Details

    • nextProgress

      public void nextProgress() throws InterruptedException
      Registers the next iteration. This method is cheap.
      Throws:
      InterruptedException
    • close

      public void close()
      Signals that the iteration is finished. Must be called to indicate that this tracker will no longer be used.
      Specified by:
      close in interface AutoCloseable