LimeWire Consolidated API

com.limegroup.gnutella
Class BandwidthTrackerImpl

java.lang.Object
  extended by com.limegroup.gnutella.BandwidthTrackerImpl
Direct Known Subclasses:
HTTPUploadSession

public class BandwidthTrackerImpl
extends Object

A helper class for implementing the BandwidthTracker interface


Constructor Summary
BandwidthTrackerImpl()
           
 
Method Summary
 float getAverageBandwidth()
          Returns the average overall bandwidth consumed.
 float getMeasuredBandwidth()
           
 void measureBandwidth(long 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(long 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.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.