|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.monkeycoder.monkeynetwork.ConnectionSpeedTimer
public class ConnectionSpeedTimer
This class is used for tracking the download rate.
| Constructor Summary | |
|---|---|
ConnectionSpeedTimer()
Creates a new ConnectionSpeedTimer. |
|
ConnectionSpeedTimer(boolean autoStart)
Creates a new ConnectionSpeedTimer and optionally starts it. |
|
| Method Summary | |
|---|---|
int |
getAverageSpeed(int inTotalBytes)
Returns average speed in rounded bytes/sec. |
int |
getSpeed(int inTotalBytes)
Returns instantaneous speed in rounded bytes/sec. |
void |
start()
Starts the timer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionSpeedTimer()
public ConnectionSpeedTimer(boolean autoStart)
autoStart - Whether or not to automatically start the timer immediately upon creation.| Method Detail |
|---|
public void start()
public int getSpeed(int inTotalBytes)
inTotalBytes - The number of bytes that have been received.
public int getAverageSpeed(int inTotalBytes)
inTotalBytes - The number of bytes that have been received.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||