org.jscience.net
Class SampleCrawlerSetting

java.lang.Object
  extended by org.jscience.net.SampleCrawlerSetting
All Implemented Interfaces:
java.io.Serializable, CrawlerSetting

public class SampleCrawlerSetting
extends java.lang.Object
implements CrawlerSetting, java.io.Serializable

SampleCrawlerSetting is what it's named: a sample CrawlerSetting. It is currently used by JSpider as the default CrawlerSetting.

See Also:
JSpider, Serialized Form

Field Summary
 boolean currentSiteOnly
          DOCUMENT ME!
static java.lang.String[] defaultRestrictURLPattern
          DOCUMENT ME!
 int depth
          DOCUMENT ME!
 boolean includeHTMLCode
          DOCUMENT ME!
 java.lang.String[] includeTextPattern
          DOCUMENT ME!
 java.lang.String[] restrictURLPattern
          DOCUMENT ME!
 
Constructor Summary
SampleCrawlerSetting()
          searches all files 3 levels deep in current site only
SampleCrawlerSetting(int depth, boolean currentSiteOnly, java.lang.String[] restrictURLPattern, java.lang.String[] includeTextPattern, boolean includeHTMLCode)
          Creates a new SampleCrawlerSetting object.
SampleCrawlerSetting(int depth, java.lang.String includeTextPattern)
          Creates a new SampleCrawlerSetting object.
 
Method Summary
 boolean followLinks(java.net.URL url, java.net.URL referer, int depth, java.util.List resultURLList, java.util.List closedURLList, java.util.List searchURLWrapperList)
          DOCUMENT ME!
 boolean isActive()
          if inactive, followLinks() always returns false
 boolean matchesCriteria(java.net.URL url, java.net.URL referer, int depth, java.util.List resultURLList, java.util.List closedURLList)
          DOCUMENT ME!
 void setActive(boolean flag)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultRestrictURLPattern

public static final java.lang.String[] defaultRestrictURLPattern
DOCUMENT ME!


depth

public int depth
DOCUMENT ME!


currentSiteOnly

public boolean currentSiteOnly
DOCUMENT ME!


restrictURLPattern

public java.lang.String[] restrictURLPattern
DOCUMENT ME!


includeTextPattern

public java.lang.String[] includeTextPattern
DOCUMENT ME!


includeHTMLCode

public boolean includeHTMLCode
DOCUMENT ME!

Constructor Detail

SampleCrawlerSetting

public SampleCrawlerSetting()
searches all files 3 levels deep in current site only


SampleCrawlerSetting

public SampleCrawlerSetting(int depth,
                            java.lang.String includeTextPattern)
Creates a new SampleCrawlerSetting object.

Parameters:
depth - DOCUMENT ME!
includeTextPattern - DOCUMENT ME!

SampleCrawlerSetting

public SampleCrawlerSetting(int depth,
                            boolean currentSiteOnly,
                            java.lang.String[] restrictURLPattern,
                            java.lang.String[] includeTextPattern,
                            boolean includeHTMLCode)
Creates a new SampleCrawlerSetting object.

Parameters:
depth - DOCUMENT ME!
currentSiteOnly - DOCUMENT ME!
restrictURLPattern - DOCUMENT ME!
includeTextPattern - DOCUMENT ME!
includeHTMLCode - DOCUMENT ME!
Method Detail

setActive

public void setActive(boolean flag)
DOCUMENT ME!

Parameters:
flag - DOCUMENT ME!

isActive

public boolean isActive()
if inactive, followLinks() always returns false

Returns:
DOCUMENT ME!

followLinks

public boolean followLinks(java.net.URL url,
                           java.net.URL referer,
                           int depth,
                           java.util.List resultURLList,
                           java.util.List closedURLList,
                           java.util.List searchURLWrapperList)
DOCUMENT ME!

Specified by:
followLinks in interface CrawlerSetting
Parameters:
url - DOCUMENT ME!
referer - DOCUMENT ME!
depth - DOCUMENT ME!
resultURLList - DOCUMENT ME!
closedURLList - DOCUMENT ME!
searchURLWrapperList - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
Spider.URLWrapper

matchesCriteria

public boolean matchesCriteria(java.net.URL url,
                               java.net.URL referer,
                               int depth,
                               java.util.List resultURLList,
                               java.util.List closedURLList)
DOCUMENT ME!

Specified by:
matchesCriteria in interface CrawlerSetting
Parameters:
url - DOCUMENT ME!
referer - DOCUMENT ME!
depth - DOCUMENT ME!
resultURLList - DOCUMENT ME!
closedURLList - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!