com.github.axet.wget
Class SpeedInfo
java.lang.Object
com.github.axet.wget.SpeedInfo
public class SpeedInfo
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SAMPLE_LENGTH
public static final int SAMPLE_LENGTH
- See Also:
- Constant Field Values
SAMPLE_MAX
public static final int SAMPLE_MAX
- See Also:
- Constant Field Values
samples
protected ArrayList<SpeedInfo.Sample> samples
peak
protected long peak
start
protected SpeedInfo.Sample start
SpeedInfo
public SpeedInfo()
start
public void start(long current)
- Start calculate speed from 'current' bytes downloaded
- Parameters:
current -
step
public void step(long current)
- step download process with 'current' bytes downloaded
- Parameters:
current -
getCurrentSpeed
public int getCurrentSpeed()
- Current download speed
- Returns:
- bytes per second
getAverageSpeed
public int getAverageSpeed()
- Average speed from start download
- Returns:
- bytes per second
getSamples
public int getSamples()
getSample
public SpeedInfo.Sample getSample(int index)
getPeak
public long getPeak()
getStart
protected SpeedInfo.Sample getStart()
add
protected void add(SpeedInfo.Sample s)
getRowSamples
protected int getRowSamples()
- return number of samples in the row (before download restart)
- Returns:
getLastUpdate
protected long getLastUpdate()
peakUpdate
protected void peakUpdate()
Copyright © 2012. All Rights Reserved.