net.sf.gsaapi
Class GSAResult

java.lang.Object
  extended bynet.sf.gsaapi.GSAResult

public class GSAResult
extends java.lang.Object

The Java binding to the result element of the XML response received from querying the GSA.

Author:
Amol S Deshmukh adeshmuk .at inxight .dot com

Constructor Summary
GSAResult()
          constructor is intended for internal use only.
 
Method Summary
 void addField(java.lang.String key, java.lang.String value)
          Add an "additional" field-value pair.
 void addMeta(java.lang.String key, java.lang.String value)
          Add a meta field value pair.
 java.lang.String getCacheDocEncoding()
          If a cached version is available, the encoding of the cached document.
 java.lang.String getCacheDocId()
          returns the cache identifier for the document.
 java.lang.String getCacheDocSize()
          String representing the value of the cached documents approximate size.
 java.lang.String getEscapedUrl()
          return the escaped url as returned by the GSA.
 java.lang.String getField(java.lang.String name)
          Get the value for the "additional" field.
 java.util.Map getFields()
          get the map of "additional" fields associated with this result (if any).
 int getIndentation()
          Get the suggested indentation level.
 java.lang.String getLanguage()
          get the language associated with this result.
 java.lang.String getMeta(java.lang.String name)
          get the value for the meta (custom) field.
 java.util.Map getMetas()
          get the map of meta information associated with this result (if any).
 java.lang.String getMimeType()
          Get the result mime type.
 int getRating()
          0-10 relevance rating for this result.
 java.lang.String getSummary()
          get result summary.
 java.lang.String getTitle()
          get result title.
 java.lang.String getUrl()
          get url for the result.
 void setCacheDocEncoding(java.lang.String cacheDocEncoding)
          set the value for encoding of the cached document.
 void setCacheDocId(java.lang.String cacheDocId)
          set value for the cache identifier for the document.
 void setCacheDocSize(java.lang.String cacheDocSize)
          set the value for the cached documents approximate size.
 void setEscapedUrl(java.lang.String escapedUrl)
          set the value for the escaped url String.
 void setFields(java.util.Map fields)
          Set the "additional" field-values associated with this result if any.
 void setIndentation(int indentation)
          set the indentation for this result item (suggestion).
 void setLanguage(java.lang.String language)
          set the language that the result is supposed to be of.
 void setMetas(java.util.Map metas)
          set the meta field-values associated with this result if any.
 void setMimeType(java.lang.String mimeType)
          Mime type of the result.
 void setRating(int rating)
          Relevance rating as returned.
 void setSummary(java.lang.String summary)
          Set the result summary.
 void setTitle(java.lang.String title)
          Set the result title.
 void setUrl(java.lang.String url)
          Set the content url for the result.
 java.lang.String toString()
          toString method: creates a String representation of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GSAResult

public GSAResult()
constructor is intended for internal use only.

Method Detail

setIndentation

public void setIndentation(int indentation)
set the indentation for this result item (suggestion). This happens typically when this the second consecutive result from the same website (domain).

Parameters:
indentation -

setLanguage

public void setLanguage(java.lang.String language)
set the language that the result is supposed to be of.

Parameters:
language -

setMetas

public void setMetas(java.util.Map metas)
set the meta field-values associated with this result if any.

Parameters:
metas -

addMeta

public void addMeta(java.lang.String key,
                    java.lang.String value)
Add a meta field value pair.

Parameters:
key - meta field key.
value - meta field value.

setFields

public void setFields(java.util.Map fields)
Set the "additional" field-values associated with this result if any. Note: Fields are not the same as meta-fields.

Parameters:
fields - Map of fields and their values.

addField

public void addField(java.lang.String key,
                     java.lang.String value)
Add an "additional" field-value pair.

Parameters:
key - field key.
value - field value.

setMimeType

public void setMimeType(java.lang.String mimeType)
Mime type of the result.

Parameters:
mimeType - The mime type of the result.

setRating

public void setRating(int rating)
Relevance rating as returned. The value should be between 0 and 10 inclusive.

Parameters:
rating - The rating (a value between 0 and 10 inclusive).

setSummary

public void setSummary(java.lang.String summary)
Set the result summary.

Parameters:
summary - The result summary.

setTitle

public void setTitle(java.lang.String title)
Set the result title.

Parameters:
title - The result title.

setUrl

public void setUrl(java.lang.String url)
Set the content url for the result.

Parameters:
url - the content url for the result.

getIndentation

public int getIndentation()
Get the suggested indentation level.

Returns:
indentation level.

getLanguage

public java.lang.String getLanguage()
get the language associated with this result.

Returns:
language string.

getMetas

public java.util.Map getMetas()
get the map of meta information associated with this result (if any).

Returns:
Map of meta information associated with this result. This is returned only if the query specifically indicated that the meta information should be returned and if the result actually had any meta information associated with it.

getMeta

public java.lang.String getMeta(java.lang.String name)
get the value for the meta (custom) field.

Parameters:
name - The name of the meta field.
Returns:
returns the value of the meta field specified by the name.

getFields

public java.util.Map getFields()
get the map of "additional" fields associated with this result (if any).

Returns:
Map of "additional" fields associated with this result. This is returned only if the result actually had any additional fields associated with it.

getField

public java.lang.String getField(java.lang.String name)
Get the value for the "additional" field.

Parameters:
name - The name of the additional field.
Returns:
returns the value of the "additional" field specified by the name

getMimeType

public java.lang.String getMimeType()
Get the result mime type.

Returns:
mime type.

getRating

public int getRating()
0-10 relevance rating for this result.

Returns:
rating as an integer.

getSummary

public java.lang.String getSummary()
get result summary.

Returns:
summary string.

getTitle

public java.lang.String getTitle()
get result title.

Returns:
title string.

getUrl

public java.lang.String getUrl()
get url for the result.

Returns:
url as a string.

getCacheDocEncoding

public java.lang.String getCacheDocEncoding()
If a cached version is available, the encoding of the cached document.

Returns:
String representing encoding of cached doc.

setCacheDocEncoding

public void setCacheDocEncoding(java.lang.String cacheDocEncoding)
set the value for encoding of the cached document.

Parameters:
cacheDocEncoding -

getCacheDocId

public java.lang.String getCacheDocId()
returns the cache identifier for the document.

Returns:
identifier for the cached doc.

setCacheDocId

public void setCacheDocId(java.lang.String cacheDocId)
set value for the cache identifier for the document.

Parameters:
cacheDocId -

getCacheDocSize

public java.lang.String getCacheDocSize()
String representing the value of the cached documents approximate size.

Returns:
size of the cached doc.

setCacheDocSize

public void setCacheDocSize(java.lang.String cacheDocSize)
set the value for the cached documents approximate size.

Parameters:
cacheDocSize -

getEscapedUrl

public java.lang.String getEscapedUrl()
return the escaped url as returned by the GSA.

Returns:
escaped url as returned by the GSA.

setEscapedUrl

public void setEscapedUrl(java.lang.String escapedUrl)
set the value for the escaped url String.

Parameters:
escapedUrl -

toString

public java.lang.String toString()
toString method: creates a String representation of the object

Returns:
the String representation


© Copyright 2006 Inxight Software, Inc.