The Encog Project

org.encog.bot.spider
Class Spider

java.lang.Object
  extended by org.encog.bot.spider.Spider

public class Spider
extends java.lang.Object

Spider: This is the main class that implements the Heaton Research Spider.


Field Summary
static int MILISECONDS2MINUTES
          Milliseconds in a minute.
static int WAIT4WORK
          How many seconds to wait for work.
 
Constructor Summary
Spider(SpiderOptions options, SpiderReportable report)
          Construct a spider object.
 
Method Summary
 void addURL(java.net.URL url, java.net.URL source, int depth)
          Add a URL for processing.
 void cancel()
          Set a flag that will cause the begin method to return before it is done.
 java.util.List<SpiderFilter> getFilters()
          Get the list of filters for the spider.
 SpiderOptions getOptions()
          Get the options for this spider.
 SpiderReportable getReport()
          Get the object that the spider reports to.
 java.lang.String getStatus()
          Generate basic status information about the spider.
 WorkloadManager getWorkloadManager()
          Get the workload manager.
 void process()
          Called to start the spider.
 void setReport(SpiderReportable report)
          Set the report object to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILISECONDS2MINUTES

public static final int MILISECONDS2MINUTES
Milliseconds in a minute.

See Also:
Constant Field Values

WAIT4WORK

public static final int WAIT4WORK
How many seconds to wait for work.

See Also:
Constant Field Values
Constructor Detail

Spider

public Spider(SpiderOptions options,
              SpiderReportable report)
Construct a spider object. The options parameter specifies the options for this spider. The report parameter specifies the class that the spider is to report progress to.

Parameters:
options - The options to run the spider with.
report - A class that implements the SpiderReportable interface, that will receive information that the spider finds.
Method Detail

addURL

public void addURL(java.net.URL url,
                   java.net.URL source,
                   int depth)
Add a URL for processing. Accepts a SpiderURL.

Parameters:
url - The URL to be added.
source - Where the URL came from.
depth - How deep is this URL.

cancel

public void cancel()
Set a flag that will cause the begin method to return before it is done.


getFilters

public java.util.List<SpiderFilter> getFilters()
Get the list of filters for the spider.

Returns:
The list of filters for the spider.

getOptions

public SpiderOptions getOptions()
Get the options for this spider.

Returns:
The options for this spider.

getReport

public SpiderReportable getReport()
Get the object that the spider reports to.

Returns:
The object that spider reports to.

getStatus

public java.lang.String getStatus()
Generate basic status information about the spider.

Returns:
The status of the spider.

getWorkloadManager

public WorkloadManager getWorkloadManager()
Get the workload manager.

Returns:
The workload manager.

process

public void process()
Called to start the spider.


setReport

public void setReport(SpiderReportable report)
Set the report object to use. The spider will report its progess to this object.

Parameters:
report - The report object to use.

The Encog Project