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

📄 torrentattributecategoryimpl.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:   TorrentAttributeCategoryImpl.java

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

import java.util.*;
import org.gudy.azureus2.core3.category.*;
import org.gudy.azureus2.plugins.torrent.*;
import org.gudy.azureus2.plugins.utils.Formatters;
import org.gudy.azureus2.plugins.utils.StaticUtilities;

// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.torrent:
//			BaseTorrentAttributeImpl

public class TorrentAttributeCategoryImpl extends BaseTorrentAttributeImpl
{

	protected TorrentAttributeCategoryImpl()
	{
		CategoryManager.addCategoryManagerListener(new CategoryManagerListener() {

			final TorrentAttributeCategoryImpl this$0;

			public void categoryAdded(final Category category)
			{
				TorrentAttributeEvent ev = new TorrentAttributeEvent() {

					final Category val$category;
					final 1 this$1;

					public int getType()
					{
						return 1;
					}

					public TorrentAttribute getAttribute()
					{
						return 0;
					}

					public Object getData()
					{
						return category.getName();
					}

					
					{
						this$1 = 1.this;
						category = category1;
						super();
					}
				};
				notifyListeners(ev);
			}

			public void categoryRemoved(final Category category)
			{
				TorrentAttributeEvent ev = new TorrentAttributeEvent() {

					final Category val$category;
					final 1 this$1;

					public int getType()
					{
						return 2;
					}

					public TorrentAttribute getAttribute()
					{
						return 0;
					}

					public Object getData()
					{
						return category.getName();
					}

					
					{
						this$1 = 1.this;
						category = category1;
						super();
					}
				};
				notifyListeners(ev);
			}

			
			{
				this$0 = TorrentAttributeCategoryImpl.this;
				super();
			}
		});
	}

	public String getName()
	{
		return "Category";
	}

	public String[] getDefinedValues()
	{
		Category categories[] = CategoryManager.getCategories();
		List v = new ArrayList();
		for (int i = 0; i < categories.length; i++)
		{
			Category cat = categories[i];
			if (cat.getType() == 0)
				v.add(cat.getName());
		}

		String res[] = new String[v.size()];
		v.toArray(res);
		Arrays.sort(res, StaticUtilities.getFormatters().getAlphanumericComparator(true));
		return res;
	}

	public void addDefinedValue(String name)
	{
		CategoryManager.createCategory(name);
	}

	public void removeDefinedValue(String name)
	{
		Category cat = CategoryManager.getCategory(name);
		if (cat != null)
			CategoryManager.removeCategory(cat);
	}

	public volatile void removeTorrentAttributeListener(TorrentAttributeListener x0)
	{
		super.removeTorrentAttributeListener(x0);
	}

	public volatile void addTorrentAttributeListener(TorrentAttributeListener x0)
	{
		super.addTorrentAttributeListener(x0);
	}
}

⌨️ 快捷键说明

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