com.limegroup.gnutella
Class BandwidthTrackerImpl

java.lang.Object
  extended bycom.limegroup.gnutella.BandwidthTrackerImpl
All Implemented Interfaces:
java.io.Serializable

public class BandwidthTrackerImpl
extends java.lang.Object
implements java.io.Serializable

A helper class for implementing the BandwidthTracker interface. For backwards compatibility, this implements the Serializable interface and marks some fields transient. However, LimeWire currently only reads but not writes BandwidthTrackerImpl.

See Also:
Serialized Form

Constructor Summary
BandwidthTrackerImpl()
           
 
Method Summary
 float getAverageBandwidth()
          Returns the average overall bandwidth consumed.
 float getMeasuredBandwidth()
           
 void measureBandwidth(int amountRead)
          Measures the data throughput since the last call to measureBandwidth, assuming this has read amountRead bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BandwidthTrackerImpl

public BandwidthTrackerImpl()
Method Detail

measureBandwidth

public void measureBandwidth(int amountRead)
Measures the data throughput since the last call to measureBandwidth, assuming this has read amountRead bytes. This value can be read by calling getMeasuredBandwidth.

Parameters:
amountRead - the cumulative amount read from this, in BYTES. Should be larger than the argument passed in the last call to measureBandwidth(..).

getMeasuredBandwidth

public float getMeasuredBandwidth()
                           throws InsufficientDataException
Throws:
InsufficientDataException
See Also:
BandwidthTracker.getMeasuredBandwidth()

getAverageBandwidth

public float getAverageBandwidth()
Returns the average overall bandwidth consumed.