com.google.soap.search
Class GoogleSearchResultElement

java.lang.Object
  |
  +--com.google.soap.search.GoogleSearchResultElement

public class GoogleSearchResultElement
extends java.lang.Object

GoogleSearchResultElement contains an individual search result component of a GoogleSearchResult. Users of the API should only call the get methods on this object; the fields are filled in when a search result is returned.

See Also:
GoogleSearchFault, GoogleSearchResult, GoogleSearchResultElement, GoogleSearchDirectoryCategory

Constructor Summary
GoogleSearchResultElement()
           
 
Method Summary
 java.lang.String getCachedSize()
          Returns the size in kilobytes of the cached version.
 GoogleSearchDirectoryCategory getDirectoryCategory()
          Returns the directory category of this result element
 java.lang.String getDirectoryTitle()
          Returns the title that appears in the directory if this document is contained in the ODP directory.
 java.lang.String getHostName()
          Returns the host name in the case where multiple results come from a single host.
 boolean getRelatedInformationPresent()
          Returns true if and only if the "related:" special query term is supported for this URL.
 java.lang.String getSnippet()
          Returns a snippet which shows the query in context on the URL where it appears.
 java.lang.String getSummary()
          Returns the ODP summary if this document is contained in the ODP directory.
 java.lang.String getTitle()
          Returns the title of the search result, formatted as HTML.
 java.lang.String getURL()
          Returns the absolute URL of the search result
 void setCachedSize(java.lang.String sz)
           
 void setDirectoryCategory(GoogleSearchDirectoryCategory cat)
           
 void setDirectoryTitle(java.lang.String dt)
           
 void setHostName(java.lang.String hn)
           
 void setRelatedInformationPresent(boolean rt)
           
 void setSnippet(java.lang.String s)
           
 void setSummary(java.lang.String ds)
           
 void setTitle(java.lang.String t)
           
 void setURL(java.lang.String u)
           
 java.lang.String toString()
          Returns a nicely formatted string representation of a Google search result element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GoogleSearchResultElement

public GoogleSearchResultElement()
Method Detail

setURL

public void setURL(java.lang.String u)

getURL

public java.lang.String getURL()
Returns the absolute URL of the search result

setTitle

public void setTitle(java.lang.String t)

getTitle

public java.lang.String getTitle()
Returns the title of the search result, formatted as HTML.

setSnippet

public void setSnippet(java.lang.String s)

getSnippet

public java.lang.String getSnippet()
Returns a snippet which shows the query in context on the URL where it appears. The query term does not always appear in the snippet. Snippets are HTML; query terms are highlighted in bold and line breaks are included for proper text wrapping.

setDirectoryCategory

public void setDirectoryCategory(GoogleSearchDirectoryCategory cat)

getDirectoryCategory

public GoogleSearchDirectoryCategory getDirectoryCategory()
Returns the directory category of this result element

setDirectoryTitle

public void setDirectoryTitle(java.lang.String dt)

getDirectoryTitle

public java.lang.String getDirectoryTitle()
Returns the title that appears in the directory if this document is contained in the ODP directory. Note that the directoryTitle may be different from the URL's <title>.

setSummary

public void setSummary(java.lang.String ds)

getSummary

public java.lang.String getSummary()
Returns the ODP summary if this document is contained in the ODP directory.

setCachedSize

public void setCachedSize(java.lang.String sz)

getCachedSize

public java.lang.String getCachedSize()
Returns the size in kilobytes of the cached version. Returns 0 if the cached version of the URL is not available.

setRelatedInformationPresent

public void setRelatedInformationPresent(boolean rt)

getRelatedInformationPresent

public boolean getRelatedInformationPresent()
Returns true if and only if the "related:" special query term is supported for this URL. The string returned provides the text of the special query term that can be invoked with this result URL.

setHostName

public void setHostName(java.lang.String hn)

getHostName

public java.lang.String getHostName()
Returns the host name in the case where multiple results come from a single host. When filtering occurs, a maximum of 2 results from any given host is returned. When this occurs, the second resultElement that comes from that host will contain the host name in this parameter.

toString

public java.lang.String toString()
Returns a nicely formatted string representation of a Google search result element.
Overrides:
toString in class java.lang.Object