Package uk.ac.starlink.table.join
Class ProgressTracker
- java.lang.Object
-
- uk.ac.starlink.table.join.ProgressTracker
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ProgressTracker extends java.lang.Object implements java.lang.AutoCloseableWraps 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 Summary
Constructors Constructor Description ProgressTracker(ProgressIndicator progger, long count, java.lang.String txt)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Signals that the iteration is finished.voidnextProgress()Registers the next iteration.
-
-
-
Constructor Detail
-
ProgressTracker
public ProgressTracker(ProgressIndicator progger, long count, java.lang.String txt)
Constructor.- Parameters:
progger- progress indicatorcount- number of invocations of progressNext expectedtxt- stage title to pass to indicator
-
-
Method Detail
-
nextProgress
public void nextProgress() throws java.lang.InterruptedExceptionRegisters the next iteration. This method is cheap.- Throws:
java.lang.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:
closein interfacejava.lang.AutoCloseable
-
-