public class MultiProgressMonitor extends Object
Output is of the format:
Task: subA: 1, subB: 75% (3/4) (-)\r Task: subA: 2, subB: 75% (3/4), subC: 1 (\)\r Task: subA: 2, subB: 100% (4/4), subC: 1 (|)\r Task: subA: 4, subB: 100% (4/4), subC: 4, done \n
Callers should try to keep task and sub-task descriptions short, since the output should fit on one terminal line. (Note that git clients do not accept terminal control characters, so true multi-line progress messages would be impossible.)
| Modifier and Type | Class and Description | 
|---|---|
| class  | MultiProgressMonitor.TaskHandle for a sub-task. | 
| Modifier and Type | Field and Description | 
|---|---|
| static int | UNKNOWNConstant indicating the total work units cannot be predicted. | 
| Constructor and Description | 
|---|
| MultiProgressMonitor(OutputStream out,
                    String taskName)Create a new progress monitor for multiple sub-tasks. | 
| MultiProgressMonitor(OutputStream out,
                    String taskName,
                    long maxIntervalTime,
                    TimeUnit maxIntervalUnit)Create a new progress monitor for multiple sub-tasks. | 
| Modifier and Type | Method and Description | 
|---|---|
| MultiProgressMonitor.Task | beginSubTask(String subTask,
            int subTaskWork)Begin a sub-task. | 
| void | end()End the overall task. | 
| void | waitFor(Future<?> workerFuture)Wait for a task managed by a  Future, with no timeout. | 
| void | waitFor(Future<?> workerFuture,
       long timeoutTime,
       TimeUnit timeoutUnit)Wait for a task managed by a  Future. | 
public static final int UNKNOWN
public MultiProgressMonitor(OutputStream out, String taskName)
out - stream for writing progress messages.taskName - name of the overall task.public MultiProgressMonitor(OutputStream out, String taskName, long maxIntervalTime, TimeUnit maxIntervalUnit)
out - stream for writing progress messages.taskName - name of the overall task.maxIntervalTime - maximum interval between progress messages.maxIntervalUnit - time unit for progress interval.public void waitFor(Future<?> workerFuture) throws ExecutionException
Future, with no timeout.ExecutionExceptionwaitFor(Future, long, TimeUnit)public void waitFor(Future<?> workerFuture, long timeoutTime, TimeUnit timeoutUnit) throws ExecutionException
Future.
 
 Must be called from the main thread, not a worker thread. Once a
 worker thread calls end(), the future has an additional
 maxInterval to finish before it is forcefully cancelled and
 ExecutionException is thrown.
workerFuture - a future that returns when worker threads are finished.timeoutTime - overall timeout for the task; the future is forcefully
     cancelled if the task exceeds the timeout. Non-positive values indicate
     no timeout.timeoutUnit - unit for overall task timeout.ExecutionException - if this thread or a worker thread was
     interrupted, the worker was cancelled, or timed out waiting for a
     worker to call end().public MultiProgressMonitor.Task beginSubTask(String subTask, int subTaskWork)
subTask - sub-task name.subTaskWork - total work units in sub-task, or UNKNOWN.public void end()
Must be called from a worker thread.