org.lastbamboo.common.download
Class RateCalculatorImpl

java.lang.Object
  extended by org.lastbamboo.common.download.RateCalculatorImpl
All Implemented Interfaces:
RateCalculator

public class RateCalculatorImpl
extends Object
implements RateCalculator

An implementation of the rate calculator interface.


Constructor Summary
RateCalculatorImpl()
          Constructs a new rate calculator.
 
Method Summary
 void addData(RangeDownloader downloader)
          Adds data for the given downloader.
 long getBytesRead()
          Accessor for the total number of bytes read.
 double getRate()
          Returns the rate since a given time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RateCalculatorImpl

public RateCalculatorImpl()
Constructs a new rate calculator.

Method Detail

getRate

public double getRate()
Description copied from interface: RateCalculator
Returns the rate since a given time.

Specified by:
getRate in interface RateCalculator
Returns:
The rate since the given time.

addData

public void addData(RangeDownloader downloader)
Description copied from interface: RateCalculator
Adds data for the given downloader.

Specified by:
addData in interface RateCalculator
Parameters:
downloader - The downloader to add data for.

getBytesRead

public long getBytesRead()
Description copied from interface: RateCalculator
Accessor for the total number of bytes read.

Specified by:
getBytesRead in interface RateCalculator
Returns:
The total number of bytes read.


Copyright © 2013 LittleShoot. All Rights Reserved.