public class ThreadForScrap
extends java.lang.Thread
to run two thread, one is itself for insert date to database, other is static (named search)and implements Runnable class for Scraping information from Internet and judge whether it can be inserted.
限定符和类型 | 字段和说明 |
---|---|
(专用程序包) AlertBox |
albox |
private loadWebSource |
lw |
private static java.lang.Thread |
search
it is static and implements Runnable class for Scraping information from Internet.
|
private java.util.LinkedList<WebScraping> |
wspS |
构造器和说明 |
---|
ThreadForScrap(loadCNF cnf)
a construcotr to creat a object.
|
限定符和类型 | 方法和说明 |
---|---|
private void |
iniSearch()
initial search Thread object
|
void |
run()
run method to set the thread fot this object, to load every data which in the
linkedlist into the database file, and it will guruntee that data is insert
from earliest to now
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private java.util.LinkedList<WebScraping> wspS
private loadWebSource lw
AlertBox albox
private static java.lang.Thread search
it is static and implements Runnable class for Scraping information from Internet.
It will use isScrap method to judge.
if can ,it will add it to a @Linkedlist;
if not, this thread will break;
loadWebSource.isScrap()
public ThreadForScrap(loadCNF cnf)
cnf
- object which has information to initialprivate void iniSearch()
public void run()
run method to set the thread fot this object, to load every data which in the linkedlist into the database file, and it will guruntee that data is insert from earliest to now
run
在接口中 java.lang.Runnable
run
在类中 java.lang.Thread