|
2.8.0: 2008-09-08 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.clients.migrate.ProgressThread
public class ProgressThread
This class provides methods for displaying the progress of a transfer. At a set interval the thread checks whether it's counter has increased, if so progress is printed to standard output.
Field Summary | |
---|---|
private boolean |
active
True if this thread is active. |
private int |
counter
|
private int |
duration
Total duration between start and stop in milliseconds |
private int |
endCount
Progress counter limit. |
private String |
itemType
The itemType that is transfered |
private int |
lastOutputCounter
Last counter printed to standard output. |
private String |
OUT_FORMAT
printf format for an output |
(package private) Thread |
progress
This progress thread |
private boolean |
unused
True if thread hasn't been started. |
private int |
updateInterval
Number of milliseconds to wait before trying to display the progress. |
Constructor Summary | |
---|---|
ProgressThread(int endCount,
String itemType)
|
Method Summary | |
---|---|
void |
decrease()
Decrease the value of the counter by one. |
void |
display()
If the progress is active this method prints out status of the progress to standard output. |
void |
increase()
Increase the counter by one. |
void |
increase(int i)
Increase the counter by i. |
private void |
printDate()
Prints date without linebreak. |
void |
run()
|
void |
start()
Starts progress |
void |
stop()
Stops the current progress. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int endCount
private int counter
private int lastOutputCounter
private boolean active
private boolean unused
private int updateInterval
private final String OUT_FORMAT
private int duration
Thread progress
private String itemType
Constructor Detail |
---|
ProgressThread(int endCount, String itemType)
endCount
- Total number of items that will be transferedMethod Detail |
---|
public void start()
public void run()
run
in interface Runnable
public void decrease()
public void increase()
public void increase(int i)
public void display()
public void stop()
private void printDate()
|
2.8.0: 2008-09-08 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |