|
3.2.1: 2012-12-13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.util.TransferRateProgressReporter
public class TransferRateProgressReporter
A progress reporter implementation that has a "side-effect" that limits the transfer rate. The parent progress reporter is optional.
Field Summary | |
---|---|
private int |
maxDelay
|
private int |
maxTicksPerSecond
|
private AbsoluteProgressReporter |
parent
|
private long |
startTime
|
Constructor Summary | |
---|---|
TransferRateProgressReporter(AbsoluteProgressReporter parent,
int maxTicksPerSecond)
Create a new progress reporter. |
|
TransferRateProgressReporter(AbsoluteProgressReporter parent,
int maxTicksPerSecond,
int maxDelay)
Create a new progress reporter. |
Method Summary | |
---|---|
void |
append(String message)
Forward the call to the parent if one exists. |
void |
display(int percent,
String message)
Forward the call to the parent if one exists. |
void |
displayAbsolute(long completed,
String message)
Forward the call to the parent if one exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final AbsoluteProgressReporter parent
private final int maxTicksPerSecond
private final int maxDelay
private long startTime
Constructor Detail |
---|
public TransferRateProgressReporter(AbsoluteProgressReporter parent, int maxTicksPerSecond)
parent
- An optional parent progress reporterticksPerSecond
- Max allowed ticks-per-second, if the rate goes above this,
the displayAbsolute(long, String)
method will wait a short time
before returningpublic TransferRateProgressReporter(AbsoluteProgressReporter parent, int maxTicksPerSecond, int maxDelay)
parent
- An optional parent progress reporterticksPerSecond
- Max allowed ticks-per-second, if the rate goes above this,
the displayAbsolute(long, String)
method will wait a short time
before returningmaxDelay
- The max delay in milliseconds for each call to displayAbsolute(long, String)
Method Detail |
---|
public void display(int percent, String message)
display
in interface ProgressReporter
percent
- How many percent of the task that is completed
or -1 if not knownmessage
- A message, or nullpublic void append(String message)
append
in interface ProgressReporter
message
- The messagepublic void displayAbsolute(long completed, String message)
displayAbsolute
in interface AbsoluteProgressReporter
completed
- The progress of the taskmessage
- A message, or null
|
3.2.1: 2012-12-13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |