downloadscraperesultimpl.java

来自「java 文件下载器。可自定义」· Java 代码 · 共 97 行

JAVA
97
字号
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   DownloadScrapeResultImpl.java

package org.gudy.azureus2.pluginsimpl.local.download;

import java.net.URL;
import org.gudy.azureus2.core3.download.DownloadManager;
import org.gudy.azureus2.core3.tracker.client.TRTrackerScraperResponse;
import org.gudy.azureus2.plugins.download.Download;
import org.gudy.azureus2.plugins.download.DownloadScrapeResult;

// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.download:
//			DownloadImpl

public class DownloadScrapeResultImpl
	implements DownloadScrapeResult
{

	protected DownloadImpl download;
	protected TRTrackerScraperResponse response;

	protected DownloadScrapeResultImpl(DownloadImpl _download, TRTrackerScraperResponse _response)
	{
		download = _download;
		response = _response;
	}

	protected void setContent(TRTrackerScraperResponse _response)
	{
		response = _response;
	}

	public Download getDownload()
	{
		return download;
	}

	public int getResponseType()
	{
		return response == null || !response.isValid() ? 2 : 1;
	}

	public int getSeedCount()
	{
		return response != null ? response.getSeeds() : -1;
	}

	public int getNonSeedCount()
	{
		return response != null ? response.getPeers() : -1;
	}

	public long getScrapeStartTime()
	{
		return response != null ? response.getScrapeStartTime() : -1L;
	}

	public void setNextScrapeStartTime(long nextScrapeStartTime)
	{
		TRTrackerScraperResponse current_response = getCurrentResponse();
		if (current_response != null)
			current_response.setNextScrapeStartTime(nextScrapeStartTime);
	}

	public long getNextScrapeStartTime()
	{
		TRTrackerScraperResponse current_response = getCurrentResponse();
		return current_response != null ? current_response.getNextScrapeStartTime() : -1L;
	}

	public String getStatus()
	{
		if (response != null)
			return response.getStatusString();
		else
			return "";
	}

	public URL getURL()
	{
		if (response != null)
			return response.getURL();
		else
			return null;
	}

	protected TRTrackerScraperResponse getCurrentResponse()
	{
		TRTrackerScraperResponse current = download.getDownload().getTrackerScrapeResponse();
		if (current == null)
			current = response;
		return current;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?