Class bdd.search.spider.Indexer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bdd.search.spider.Indexer

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----bdd.search.spider.Indexer

public class Indexer
extends Thread
Written by Tim Macinta 1997
Distributed under the GNU Public License (a copy of which is enclosed with the source).

The Indexer is a thread which can index URLs that have been cached using the URLStatus class. Use the queueURL() method to add cached URLs to the Indexer's list of URLs. Once the start() method is called, the Indexer will start processing URLs in its queue. More URLs can also be added after calling start, in fact this may be the best way to use the Indexer. Calling the stopWhenDone() method will cause the Indexer thread to stop as soon as its queue empties.

Constructor Index

 o Indexer(File, Crawler, EnginePrefs)
"working_dir" should be a directory that only this Indexer and a given Cralwer will be accessing.

Method Index

 o queueURL(URLStatus)
Use this method to add a cached url to the Indexer.
 o run()
This is where the actual indexing is done.
 o start()
Starts the Indexer.
 o stopWhenDone(boolean)
Causes this Indexer to stop whenever it finishes indexing the URLs in its queue.

Constructors

 o Indexer
  public Indexer(File working_dir,
                 Crawler crawler,
                 EnginePrefs prefs)
"working_dir" should be a directory that only this Indexer and a given Cralwer will be accessing. This means that if several Indexers are running simultaneously, they should all be given different "working_dir" directories. Also, no other threads should write to this directory (except for the selected Crawler).

Methods

 o queueURL
  public void queueURL(URLStatus url)
Use this method to add a cached url to the Indexer.
 o start
  public void start()
Starts the Indexer.
Overrides:
start in class Thread
 o run
  public void run()
This is where the actual indexing is done.
Overrides:
run in class Thread
 o stopWhenDone
  public void stopWhenDone(boolean exit_when_done)
Causes this Indexer to stop whenever it finishes indexing the URLs in its queue.

All Packages  Class Hierarchy  This Package  Previous  Next  Index