Class DB
java.lang.Object
|
+----DB
- public class DB
- extends Object
DB class store all the html files downloaded
it has 3 member variables,
Hashtable d_table: hash table to store all pages, indexed by its URL
int d_max_level: max recursive level
String d_keyword: keyword search,
if not null, only page containing that key word will be saved
-
DB(int)
- create an empty DB object
-
DB(int, String)
- create an empty DB object
-
exist(URL)
- test if the given URL has already existed in the DB
-
get(URL)
- retrieve a HTMLpage object from the database
-
insert(HTMLpage)
- insert a HTMLpage ogject to the database
index key is the URL of the page
-
load(RunDlg, URL, int)
- load (or maybe download is a better name) from a URL,
this is a recursive function
-
save(String)
- save the DB's content to a given directory
DB
public DB(int level)
- create an empty DB object
- Parameters:
- level - max recursive level
no keyword search will be performed
DB
public DB(int level,
String key)
- create an empty DB object
- Parameters:
- level - max recursive level
- key - keyword string
get
public HTMLpage get(URL key)
- retrieve a HTMLpage object from the database
- Parameters:
- key - the complete URL of the page
insert
public boolean insert(HTMLpage apage)
- insert a HTMLpage ogject to the database
index key is the URL of the page
exist
public boolean exist(URL key)
- test if the given URL has already existed in the DB
save
public boolean save(String dir)
- save the DB's content to a given directory
- Parameters:
- dir - the path
load
public void load(RunDlg myrun,
URL base,
int level)
- load (or maybe download is a better name) from a URL,
this is a recursive function
- Parameters:
- RunDlg - the Dialog to show progress
- URL - the URL of the page
- level - current recursive level