edu.mit.jmwe.util
Interface IProgressBar

All Known Implementing Classes:
NullProgressBar, ProgressBar

public interface IProgressBar

Progress bars allow operations to report progress. The progress bar is started when instantiated, and expects a certain number of 'units' of progress. A unit of progress is reported by calling the increment() or multiple units can be reported by calling increment(int). When the task is finished, the reporter should call the finish() method.

Since:
jMWE 1.0.0
Version:
$Id: IProgressBar.java 553 2011-05-05 19:17:02Z markaf $
Author:
M.A. Finlayson, N. Kulkarni

Method Summary
 void finish()
          Stops the progress bar and prints the total time that the progress bar ran.
 int getCount()
          Returns the current state of the progress bar, that is, the number of units of progress that have been reported to it.
 Date getEndTime()
          Returns the date and time on which this progress bar was finished.
 int getExpected()
          Returns the expected number of units of progress.
 int getExpectedTicks()
          Returns the expected number of ticks.
 Date getStartTime()
          Returns the date and time on which this progress bar was started.
 double getStepSize()
          Returns the number of units of progress that are represented by one tick.
 int getTickCount()
          Returns the number of current progress bar ticks that have been used.
 void increment()
          Increments the progress bar by 1.
 void increment(int amount)
          Increments the progress bar by a given amount.
 

Method Detail

getCount

int getCount()
Returns the current state of the progress bar, that is, the number of units of progress that have been reported to it.

Returns:
the number of units of progress so far reported
Since:
jMWE 1.0.0

getTickCount

int getTickCount()
Returns the number of current progress bar ticks that have been used.

Returns:
the number of current progress bar ticks that have been used.
Since:
jMWE 1.0.0

getExpected

int getExpected()
Returns the expected number of units of progress.

Returns:
the expected number of units of progress.
Since:
jMWE 1.0.0

getExpectedTicks

int getExpectedTicks()
Returns the expected number of ticks.

Returns:
the expected number of ticks.
Since:
jMWE 1.0.0

getStepSize

double getStepSize()
Returns the number of units of progress that are represented by one tick.

Returns:
the number of units of progress that are represented by one tick.
Since:
jMWE 1.0.0

getStartTime

Date getStartTime()
Returns the date and time on which this progress bar was started.

Returns:
the date and time on which this progress bar was started.
Since:
jMWE 1.0.0

getEndTime

Date getEndTime()
Returns the date and time on which this progress bar was finished. If the progress bar is not yet finished, will return null.

Returns:
the date and time on which this progress bar was finished, or null if not yet finished.
Since:
jMWE 1.0.0

increment

void increment()
Increments the progress bar by 1.

Since:
jMWE 1.0.0

increment

void increment(int amount)
Increments the progress bar by a given amount.

Parameters:
amount - amount by which the progress bar will be incremented
Since:
jMWE 1.0.0

finish

void finish()
Stops the progress bar and prints the total time that the progress bar ran.

Since:
jMWE 1.0.0


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.