⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 downloadannounceresultimpl.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// 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:   DownloadAnnounceResultImpl.java

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

import java.net.URL;
import java.util.Map;
import org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncerResponse;
import org.gudy.azureus2.plugins.download.*;
import org.gudy.azureus2.plugins.peers.PeerManager;
import org.gudy.azureus2.plugins.peers.PeerManagerStats;

public class DownloadAnnounceResultImpl
	implements DownloadAnnounceResult
{

	protected Download download;
	protected TRTrackerAnnouncerResponse response;

	public DownloadAnnounceResultImpl(Download _download, TRTrackerAnnouncerResponse _response)
	{
		download = _download;
		response = _response;
	}

	public void setContent(TRTrackerAnnouncerResponse _response)
	{
		response = _response;
	}

	public Download getDownload()
	{
		return download;
	}

	public int getResponseType()
	{
		if (response == null)
			return 2;
		int status = response.getStatus();
		return status != 2 ? 2 : 1;
	}

	public int getReportedPeerCount()
	{
		return response != null && response.getPeers() != null ? response.getPeers().length : 0;
	}

	public int getSeedCount()
	{
		PeerManager pm = download.getPeerManager();
		if (pm != null)
			return pm.getStats().getConnectedSeeds();
		else
			return 0;
	}

	public int getNonSeedCount()
	{
		PeerManager pm = download.getPeerManager();
		if (pm != null)
			return pm.getStats().getConnectedLeechers();
		else
			return 0;
	}

	public String getError()
	{
		return response != null ? response.getAdditionalInfo() : "No Response";
	}

	public URL getURL()
	{
		return response != null ? response.getURL() : null;
	}

	public DownloadAnnounceResultPeer[] getPeers()
	{
		if (response == null)
			return new DownloadAnnounceResultPeer[0];
		else
			return response.getPeers();
	}

	public long getTimeToWait()
	{
		if (response == null)
			return -1L;
		else
			return response.getTimeToWait();
	}

	public Map getExtensions()
	{
		if (response == null)
			return null;
		else
			return response.getExtensions();
	}
}

⌨️ 快捷键说明

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