|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.util.progresswatch.ProgressWatcher
public class ProgressWatcher
Simple class who's goal is to: 1) Total up the amount of work to be done 2) Track the amount of work that is actually done 3) Report the % of the work completed The amount of work is arbitrary and stored in simple integer format. Percent complete is calculated based on the finished work divided by the work remaining. Possible additions to the future could add ability to track timing (current, remaining estimate).
| Constructor Summary | |
|---|---|
ProgressWatcher()
|
|
| Method Summary | |
|---|---|
void |
addWork(int workToAdd)
Add a unit of work to be completed. |
void |
finishWork(int workToRemove)
Indicate that a # of work units has been completed. |
int |
getPercentComplete()
Get the percentage complete of the total work specified. |
void |
resetToZero()
Reset the ProgressWatcher to zero. |
void |
setTotalWork(int totalWorkIn)
Set the total amount of work to be completed. |
void |
start()
Start watching the progress of a given amount of work. |
void |
stop()
Indicate this ProgressWatcher is finished watching. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProgressWatcher()
| Method Detail |
|---|
public void start()
public int getPercentComplete()
throws IllegalStateException
IllegalStateException - if this ProgressWatcher has not been started yet.public void setTotalWork(int totalWorkIn)
totalWorkIn - to set.public void addWork(int workToAdd)
workToAdd - public void finishWork(int workToRemove)
workToRemove - public void stop()
public void resetToZero()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||