com.limegroup.gnutella.statistics
Class AbstractKilobytesStatistic

java.lang.Object
  extended bycom.limegroup.gnutella.statistics.AbstractStatistic
      extended bycom.limegroup.gnutella.statistics.AbstractKilobytesStatistic
All Implemented Interfaces:
Statistic
Direct Known Subclasses:
com.limegroup.gnutella.statistics.AdvancedKilobytesStatistic, com.limegroup.gnutella.statistics.BasicKilobytesStatistic

public abstract class AbstractKilobytesStatistic
extends AbstractStatistic

Specialized class for Gnutella message statistics. This class modifies data accessors to return data in kilobits instead of bytes. To preserve data accuracy, data is stored in bytes and converted to kilobits. If we did not do this, data would be lost.


Field Summary
 
Fields inherited from class com.limegroup.gnutella.statistics.AbstractStatistic
_buffer, _current, _fileName, _max, _total, _totalStatsRecorded, STATS_MANAGER
 
Fields inherited from interface com.limegroup.gnutella.statistics.Statistic
HISTORY_LENGTH
 
Constructor Summary
AbstractKilobytesStatistic()
           
 
Method Summary
 double getAverage()
          Overridden to report the average for this statistic in kilobyes.
 double getMax()
          Overridden to report the maximum for this statistic in kilobyes.
 double getTotal()
          Overridden to report the total for this statistic in kilobytes.
 
Methods inherited from class com.limegroup.gnutella.statistics.AbstractStatistic
addData, clearData, getStatHistory, incrementStat, initializeBuffer, setWriteStatToFile, storeCurrentStat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractKilobytesStatistic

public AbstractKilobytesStatistic()
Method Detail

getAverage

public double getAverage()
Overridden to report the average for this statistic in kilobyes.

Specified by:
getAverage in interface Statistic
Overrides:
getAverage in class AbstractStatistic
Returns:
the average for this statistic in kilobytes per unit of measurement (KB/s)

getMax

public double getMax()
Overridden to report the maximum for this statistic in kilobyes.

Specified by:
getMax in interface Statistic
Overrides:
getMax in class AbstractStatistic
Returns:
the maximum for a recorded time period for this statistic in kilobytes

getTotal

public double getTotal()
Overridden to report the total for this statistic in kilobytes.

Specified by:
getTotal in interface Statistic
Overrides:
getTotal in class AbstractStatistic
Returns:
the total for this statistic in kilobytes