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

📄 threadhelper.java

📁 利用多线程从搜索引擎下载网页并提取数据到数据库。
💻 JAVA
字号:
import java.util.List;


public class ThreadHelper implements Runnable {

	
	int tc;
	List<Thread> threads;
	List<ProfileDL> instances;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	public void run() {
		exitThreads();
		
	}
	
	public ThreadHelper(int tc,List<Thread> threads, List<ProfileDL> instances)
	{
		this.tc=tc;
		this.threads=threads;
		this.instances=instances;		
	}
	
	private void exitThreads() {
		int i;
		for (i = 0; i < tc; i++) {
			if (threads.get(i).isAlive()) {
				instances.get(i).exit(threads.get(i).getName());
			}
		}
	}
}

⌨️ 快捷键说明

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