edu.jhu.tmaj.util
Class TextProgressMonitor

java.lang.Object
  extended by edu.jhu.tmaj.util.TextProgressMonitor

public final class TextProgressMonitor
extends java.lang.Object

A Class used to monitor the progress of a long text-based task. Generally, the increment() method is placed inside the for loop doing each part of the task.


Field Summary
static int UPDATE_TIME
           
 
Constructor Summary
TextProgressMonitor(long totalItems, java.lang.String taskDescription)
           
TextProgressMonitor(long totalItems, java.lang.String taskDescription, boolean autoStart)
          Construct this object.
 
Method Summary
 void finish()
          Indicate to user task has finished.
 void increment()
          Increment the total number of parts completed.
 void printManualUpdate(java.lang.String message)
           
 void start()
          Indicate to user task has begun.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_TIME

public static final int UPDATE_TIME
See Also:
Constant Field Values
Constructor Detail

TextProgressMonitor

public TextProgressMonitor(long totalItems,
                           java.lang.String taskDescription)

TextProgressMonitor

public TextProgressMonitor(long totalItems,
                           java.lang.String taskDescription,
                           boolean autoStart)
Construct this object.

Parameters:
totalItems - total number of items to be processed.
taskDescription - a short description of this task
autoStart - automatically start() if true
Method Detail

start

public void start()
Indicate to user task has begun.


finish

public void finish()
Indicate to user task has finished.


increment

public void increment()
Increment the total number of parts completed.


printManualUpdate

public void printManualUpdate(java.lang.String message)