Spreadsheet Toolkit

corpus.gobbler
Class SearchMethod

java.lang.Object
  |
  +--corpus.gobbler.SearchMethod
Direct Known Subclasses:
GoogleAPISearch, GoogleHTTPGetSearch

public abstract class SearchMethod
extends java.lang.Object

Title: SearchMethod

Description: Represents a way of finding URL's for certain file types.

Copyright: Copyright (c) 2003

Company: VUW:MCS


Field Summary
protected  java.lang.String fileType
           
protected  int numPerPage
           
protected  SearchResult result
           
protected  java.lang.String searchString
           
 
Constructor Summary
SearchMethod(java.lang.String searchString, java.lang.String fileType, int numPerPage, Gobbler gobbler)
          Create a SearchMethod
 
Method Summary
protected abstract  int EstimateTotalResults()
           
protected  void html(java.lang.String s)
           
protected  void newEstimate(int ne)
           
 SearchResult performSearch(int targetnum)
          Starts interaction with Google.
protected abstract  SearchResult StartSearch(int startNumber)
           
protected  void status(java.lang.String s)
           
protected  void urlCountTick()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

searchString

protected java.lang.String searchString

numPerPage

protected int numPerPage

fileType

protected java.lang.String fileType

result

protected SearchResult result
Constructor Detail

SearchMethod

public SearchMethod(java.lang.String searchString,
                    java.lang.String fileType,
                    int numPerPage,
                    Gobbler gobbler)
Create a SearchMethod

Method Detail

status

protected void status(java.lang.String s)

html

protected void html(java.lang.String s)

urlCountTick

protected void urlCountTick()

newEstimate

protected void newEstimate(int ne)

StartSearch

protected abstract SearchResult StartSearch(int startNumber)

EstimateTotalResults

protected abstract int EstimateTotalResults()

performSearch

public SearchResult performSearch(int targetnum)
Starts interaction with Google. Does the following:
  1. Sends Request to Google for search Page
  2. Checks to see if the target number of results is greater than the actual number available
  3. Extracts URLs from the search page
  4. Continues getting search pages and extracting URLs until the target is meet.
  5. Stores the URLs for later retrival.

Parameters:
targetnum - The total number of results wanted. (Will be reduced if it exceeds the total number of results available)

Spreadsheet Toolkit

Project Home Page