FileDocCategorySizeDatePackage
TRTrackerServerTorrentStatsImpl.javaAPI DocAzureus 3.0.3.43565Tue Jun 05 10:36:40 BST 2007org.gudy.azureus2.core3.tracker.server.impl

TRTrackerServerTorrentStatsImpl

public class TRTrackerServerTorrentStatsImpl extends Object implements TRTrackerServerTorrentStats
author
parg

Fields Summary
private TRTrackerServerTorrentImpl
torrent
private long
announce_count
private long
scrape_count
private long
completed_count
private long
uploaded
private long
downloaded
private long
left
private long
biased_uploaded
private long
biased_downloaded
private long
bytes_in
private long
bytes_out
Constructors Summary
protected TRTrackerServerTorrentStatsImpl(TRTrackerServerTorrentImpl _torrent)

		torrent	= _torrent;
	
Methods Summary
protected voidaddAnnounce(long ul_diff, long dl_diff, long le_diff, boolean biased_peer)

		announce_count++;
		
		uploaded	+= ul_diff<0?0:ul_diff;	// should always be +ve
		downloaded	+= dl_diff<0?0:dl_diff;
		left		+= le_diff;	// can be +ve at start (0->x) then neg after
		
		if ( left < 0 ){
			
			left	= 0;
		}
		
		if ( biased_peer ){
			
			biased_uploaded		+= ul_diff<0?0:ul_diff;	// should always be +ve
			biased_downloaded	+= dl_diff<0?0:dl_diff;
		}
	
protected voidaddCompleted()

		completed_count++;
	
protected voidaddScrape()

		scrape_count++;
	
protected voidaddXferStats(int in, int out)

		bytes_in	+= in;
		bytes_out	+= out;
	
public longgetAmountLeft()

		return( left );
	
public longgetAnnounceCount()

		return( announce_count );
	
public intgetBadNATPeerCount()

		return( torrent.getBadNATPeerCount());
	
public longgetBiasedDownloaded()

		return( biased_downloaded );
	
public longgetBiasedUploaded()

		return( biased_uploaded );
	
public longgetBytesIn()

		return( bytes_in );
	
public longgetBytesOut()

		return( bytes_out );
	
public longgetCompletedCount()

		return( completed_count );
	
public longgetDownloaded()

		return( downloaded );
	
public intgetLeecherCount()

		return( torrent.getLeecherCount());
	
public intgetQueuedCount()

		return( torrent.getQueuedCount());
	
public longgetScrapeCount()

		return( scrape_count );
	
public intgetSeedCount()

		return( torrent.getSeedCount());
	
public java.lang.StringgetString()

		return( "an=" + announce_count + ",sc=" + scrape_count + ",co=" + completed_count +",le=" + getLeecherCount() + ",se=" + getSeedCount() + ",q=" + getQueuedCount() + ",bi=" + bytes_in + ",bo=" + bytes_out );
	
public longgetUploaded()

		return( uploaded );
	
protected voidremoveLeft(long _left)

		left	-= _left;
		
		if ( left < 0 ){
			
			left	= 0;
		}