public class DownloadSpeedMonitor extends java.lang.Object implements IDownloadSpeed.Monitor, IDownloadSpeed.Lookup
| Constructor and Description |
|---|
DownloadSpeedMonitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
end(long sofarBytes)
End the monitor, and calculate the average speed during the entire downloading processing
|
int |
getSpeed() |
void |
reset()
Reset the monitor.
|
void |
setMinIntervalUpdateSpeed(int minIntervalUpdateSpeed) |
void |
start(long startBytes)
Start the monitor.
|
void |
update(long sofarBytes)
Refresh the downloading speed.
|
public void start(long startBytes)
IDownloadSpeed.Monitorstart in interface IDownloadSpeed.Monitorpublic void end(long sofarBytes)
IDownloadSpeed.Monitorend in interface IDownloadSpeed.MonitorsofarBytes - The so far downloaded bytes.public void update(long sofarBytes)
IDownloadSpeed.Monitorupdate in interface IDownloadSpeed.MonitorsofarBytes - The so far downloaded bytes.public void reset()
IDownloadSpeed.Monitorreset in interface IDownloadSpeed.Monitorpublic int getSpeed()
getSpeed in interface IDownloadSpeed.Lookuppublic void setMinIntervalUpdateSpeed(int minIntervalUpdateSpeed)
setMinIntervalUpdateSpeed in interface IDownloadSpeed.LookupminIntervalUpdateSpeed - The minimum interval to update the speed, used to adjust
the refresh frequent.