com.antelmann.net
Class GoogleWrapper
java.lang.Object
com.antelmann.net.GoogleWrapper
@ThirdParty(value="uses google apis")
public class GoogleWrapper
- extends Object
GoogleWrapper is a simple wrapper around the Google.com search API capabilities
to make it more easily usable.
This class requires googleapi.jar, which can be obtained from
http://www.google.com/apis
- Author:
- Holger Antelmann
- See Also:
GoogleSearch
|
Method Summary |
int |
numberOfResults(String searchString)
|
int |
pageRank(String urlPattern,
String searchString,
int maxRank)
returns the rank of the first page where the urlPattern is found within
the search result produced by a query using the searchString;
0 is returned if the URL is not within the result |
com.google.soap.search.GoogleSearchResult |
search(String searchString)
|
com.google.soap.search.GoogleSearchResult |
search(String searchString,
int beginIndex)
|
String |
spell(String text)
returns a spelling suggestion for the given text from Google |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_SEARCH_RESULTS
public static final int MAX_SEARCH_RESULTS
- See Also:
- Constant Field Values
MAX_TOTAL_RESULTS
public static final int MAX_TOTAL_RESULTS
- See Also:
- Constant Field Values
GoogleWrapper
public GoogleWrapper(String key)
pageRank
public int pageRank(String urlPattern,
String searchString,
int maxRank)
throws IOException
- returns the rank of the first page where the urlPattern is found within
the search result produced by a query using the searchString;
0 is returned if the URL is not within the result
- Parameters:
maxRank - limits the number of result entries searched and
must be between 1 and 1000
- Throws:
IOException
numberOfResults
public int numberOfResults(String searchString)
throws IOException
- Throws:
IOException
search
public com.google.soap.search.GoogleSearchResult search(String searchString)
throws IOException
- Throws:
IOException
search
public com.google.soap.search.GoogleSearchResult search(String searchString,
int beginIndex)
throws IOException
- Parameters:
beginIndex - denotes the first index returned; starts with 0
- Throws:
IOException
spell
public String spell(String text)
throws IOException
- returns a spelling suggestion for the given text from Google
- Throws:
IOException
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads