FileDocCategorySizeDatePackage
DownloadStatsImpl.javaAPI DocAzureus 3.0.3.44487Tue Dec 26 14:01:30 GMT 2006org.gudy.azureus2.pluginsimpl.local.download

DownloadStatsImpl

public class DownloadStatsImpl extends Object implements org.gudy.azureus2.plugins.download.DownloadStats
author
parg

Fields Summary
protected DownloadManager
dm
protected DownloadManagerStats
dm_stats
Constructors Summary
protected DownloadStatsImpl(DownloadManager _dm)

		dm 			= _dm;
		dm_stats	= dm.getStats();
	
Methods Summary
public floatgetAvailability()

		return( dm_stats.getAvailability());
	
public intgetCheckingDoneInThousandNotation()

		org.gudy.azureus2.core3.disk.DiskManager	disk = dm.getDiskManager();
 		
 		if ( disk != null ){
 			
 			return( disk.getCompleteRecheckStatus());
 		}
 		
 		return( -1 );
	
public intgetCompleted()

		return( dm_stats.getCompleted());
	
public longgetDiscarded()

		return( dm_stats.getDiscarded());
	
public longgetDownloadAverage()

		return( dm_stats.getDataReceiveRate());
	
public intgetDownloadCompleted(boolean bLive)

		return( dm_stats.getDownloadCompleted(bLive) );
	
public java.lang.StringgetDownloadDirectory()

		return( dm.getSaveLocation().getParent());
	
public longgetDownloaded()

		return( dm_stats.getTotalDataBytesReceived());
	
public java.lang.StringgetETA()

		return(DisplayFormatters.formatETA(dm_stats.getETA()));
	
public java.lang.StringgetElapsedTime()

		return( dm_stats.getElapsedTime());
	
public longgetHashFails()

		
		return( dm_stats.getHashFailCount());
	
public intgetHealth()

		switch( dm.getHealthStatus()){
		
			case DownloadManager.WEALTH_STOPPED:
			{
				return( DownloadStats.HEALTH_STOPPED );
			
			}
			case DownloadManager.WEALTH_NO_TRACKER:
			{
				return( DownloadStats.HEALTH_NO_TRACKER );
			
			}
			case DownloadManager.WEALTH_NO_REMOTE:
			{
				return( DownloadStats.HEALTH_NO_REMOTE );
			
			}
			case DownloadManager.WEALTH_OK:
			{
				return( DownloadStats.HEALTH_OK );
			
			}
			case DownloadManager.WEALTH_KO:
			{
				return( DownloadStats.HEALTH_KO );
			
			}
			case DownloadManager.WEALTH_ERROR:
			{
				return( DownloadStats.HEALTH_ERROR );
			}
			default:
			{
				Debug.out( "Invalid health status" );
				
				return( dm.getHealthStatus());
			
			}
		}
	
public longgetRemaining()

		return( dm_stats.getRemaining());
	
public longgetSecondsDownloading()

	  return dm_stats.getSecondsDownloading();
	
public longgetSecondsOnlySeeding()

		return dm_stats.getSecondsOnlySeeding();
	
public longgetSecondsSinceLastDownload()

		return(dm_stats.getTimeSinceLastDataReceivedInSeconds());
	
public longgetSecondsSinceLastUpload()

		return(dm_stats.getTimeSinceLastDataSentInSeconds());
	
public intgetShareRatio()

		return( dm_stats.getShareRatio());
	
public java.lang.StringgetStatus()

		return( DisplayFormatters.formatDownloadStatusDefaultLocale( dm));
	
public java.lang.StringgetStatus(boolean localised)

		return (localised)? DisplayFormatters.formatDownloadStatus( dm ) : getStatus();
			
	
public java.lang.StringgetTargetFileOrDir()

		
		return( dm.getSaveLocation().toString());
	
public longgetTimeStarted()

		return (dm_stats.getTimeStarted());
	
public longgetTimeStartedSeeding()

	  return dm_stats.getTimeStartedSeeding();
	
public longgetTotalAverage()

		return( dm_stats.getTotalAverage());
	
public java.lang.StringgetTrackerStatus()

		return(dm.getTrackerStatus());
	
public longgetUploadAverage()

		return( dm_stats.getDataSendRate());
	
public longgetUploaded()

		return( dm_stats.getTotalDataBytesSent());