websphinx.searchengine
Class Search

java.lang.Object
  |
  +--websphinx.Crawler
        |
        +--websphinx.searchengine.Search
All Implemented Interfaces:
java.util.Enumeration, java.lang.Runnable, java.io.Serializable

public class Search
extends Crawler
implements java.util.Enumeration

See Also:
Serialized Form

Field Summary
(package private)  int approxCount
           
(package private)  boolean crawling
           
(package private)  int maxResults
           
(package private)  int nextResult
           
(package private)  java.util.Vector results
           
(package private)  int walkedResults
           
 
Fields inherited from class websphinx.Crawler
action, ALL_LINKS, classifiers, crawledRoots, crawlListeners, crawlQueue, depthFirst, domain, dp, fetchQueue, HYPERLINKS, HYPERLINKS_AND_IMAGES, ignoreVisitedLinks, linkListeners, linkPredicate, maxDepth, name, numLinksTested, numPagesLeft, numPagesVisited, pagePredicate, robotExclusion, rootHrefs, roots, serialVersionUID, SERVER, state, SUBTREE, synchronous, type, visitedPages, WEB, worms
 
Constructor Summary
Search()
           
Search(int maxResults)
           
Search(SearchEngine engine, java.lang.String keywords)
           
Search(SearchEngine engine, java.lang.String keywords, int maxResults)
           
 
Method Summary
 void addQuery(SearchEngine engine, java.lang.String keywords)
           
(package private) static java.lang.String concat(java.lang.String[] args, int start)
           
 int count()
           
 boolean hasMoreElements()
           
static void main(java.lang.String[] args)
           
 java.lang.Object nextElement()
           
 SearchEngineResult nextResult()
           
 void run()
          Start crawling.
 void search()
           
 boolean shouldVisit(Link link)
          Callback for testing whether a link should be traversed.
 void visit(Page page)
          Callback for visiting a page.
 
Methods inherited from class websphinx.Crawler
addClassifier, addCrawlListener, addLinkListener, addRoot, clear, clearVisited, enumerateClassifiers, enumerateQueue, expand, fetch, fetchTimedOut, getAction, getActiveThreads, getClassifiers, getCrawledRoots, getDepthFirst, getDomain, getDownloadParameters, getIgnoreVisitedLinks, getLinkPredicate, getLinksTested, getLinkType, getMaxDepth, getName, getPagePredicate, getPagesLeft, getPagesVisited, getRootHrefs, getRoots, getState, getSynchronous, init, markVisited, pause, process, readObject, removeAllClassifiers, removeClassifier, removeCrawlListener, removeLinkListener, sendCrawlEvent, sendLinkEvent, sendLinkEvent, setAction, setDepthFirst, setDomain, setDownloadParameters, setIgnoreVisitedLinks, setLinkPredicate, setLinkType, setMaxDepth, setName, setPagePredicate, setRoot, setRootHrefs, setRoots, setSynchronous, stop, submit, submit, timedOut, toString, useStandard, visited, writeObject
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

maxResults

int maxResults

walkedResults

int walkedResults

results

java.util.Vector results

nextResult

int nextResult

approxCount

int approxCount

crawling

boolean crawling
Constructor Detail

Search

public Search()

Search

public Search(int maxResults)

Search

public Search(SearchEngine engine,
              java.lang.String keywords,
              int maxResults)

Search

public Search(SearchEngine engine,
              java.lang.String keywords)
Method Detail

addQuery

public void addQuery(SearchEngine engine,
                     java.lang.String keywords)

search

public void search()

count

public int count()

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
Specified by:
nextElement in interface java.util.Enumeration

nextResult

public SearchEngineResult nextResult()

run

public void run()
Description copied from class: Crawler
Start crawling. Returns either when the crawl is done, or when pause() or stop() is called. Because this method implements the java.lang.Runnable interface, a crawler can be run in the background thread.
Overrides:
run in class Crawler

visit

public void visit(Page page)
Description copied from class: Crawler
Callback for visiting a page. Default version does nothing.
Overrides:
visit in class Crawler
Following copied from class: websphinx.Crawler
Parameters:
page - Page retrieved by the crawler

shouldVisit

public boolean shouldVisit(Link link)
Description copied from class: Crawler
Callback for testing whether a link should be traversed. Default version returns true for all links. Override this method for more interesting behavior.
Overrides:
shouldVisit in class Crawler
Following copied from class: websphinx.Crawler
Parameters:
l - Link encountered by the crawler
Returns:
true if link should be followed, false if it should be ignored.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception

concat

static java.lang.String concat(java.lang.String[] args,
                               int start)