public class DownloadProgressTracker
extends java.lang.Object
Constructor and Description |
---|
DownloadProgressTracker(double totalLength)
ctor
|
Modifier and Type | Method and Description |
---|---|
boolean |
contentReceived(int len,
long currentTime)
Update internal state for amount of data received If conditions are met for starting a new
block, then additional internal state is updated
|
boolean |
contentReceived(long totalBytesSoFar,
long totalLen,
long currentTime) |
void |
error()
Upon error, clear progress flag (e.g.
|
double |
getAverageSpeed()
Bytes per Millisecond
|
long |
getCurrentLength() |
int |
getCurrentProgress()
Percentage
|
long |
getTimeRemaining()
Milliseconds (estimated)
|
boolean |
isProgressMade() |
void |
notified(long currentTime)
User has been notified, finish updating internal state to start new block
|
void |
setCurrentLength(long length) |
public DownloadProgressTracker(double totalLength)
totalLength
- public boolean contentReceived(long totalBytesSoFar, long totalLen, long currentTime)
public boolean contentReceived(int len, long currentTime)
len
- currentTime
- public void notified(long currentTime)
currentTime
- public boolean isProgressMade()
public void error()
public int getCurrentProgress()
public double getAverageSpeed()
public long getTimeRemaining()
public void setCurrentLength(long length)
public long getCurrentLength()