bing
Class Bing

java.lang.Object
  extended by bing.Bing

public class Bing
extends java.lang.Object

A service object used to send, receive, and process Bing API requests and responses.


Field Summary
static java.lang.String BING_URL
           
 
Constructor Summary
Bing(java.lang.String application_ID)
          Initialize a Bing service object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static java.lang.String format(java.lang.String format, java.lang.Object[] args)
          Internal use only, but for those who want to know it is a manual implemented java.text.MessageFormat.
 java.lang.String getAppID()
          Get the Bing Application ID
 boolean getErrorReturn()
          Get if an error occurs that is server-side, should a BingError be returned in the result.
 int hashCode()
           
 java.lang.String requestUrl(java.lang.String query, BingRequest request)
          Generates the URL to use in order to query the Bing API with.
 BingResponse search(java.lang.String query, BingRequest request)
          Perform a synchronous search on the Bing API.
 void search(java.lang.String query, BingRequest request, BingAsyncRequestNotification delegate)
          Perform an asynchronous search on the Bing API.
 void setAppID(java.lang.String appId)
          Set the Bing Application ID.
 void setErrorReturn(boolean error)
          Set if an error occurs that is server-side, should a BingError be returned in the result.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BING_URL

public static final java.lang.String BING_URL
See Also:
Constant Field Values
Constructor Detail

Bing

public Bing(java.lang.String application_ID)
Initialize a Bing service object. To obtain a Bing Application ID visit http://www.bing.com/developers

Parameters:
application_ID - A valid Bing Application ID
Method Detail

setErrorReturn

public void setErrorReturn(boolean error)
Set if an error occurs that is server-side, should a BingError be returned in the result.

Parameters:
error - true if an error should be returned, false if otherwise.

getErrorReturn

public boolean getErrorReturn()
Get if an error occurs that is server-side, should a BingError be returned in the result.

Returns:
true if an error should be returned, false if otherwise.

getAppID

public java.lang.String getAppID()
Get the Bing Application ID

Returns:
The Bing Application ID

setAppID

public void setAppID(java.lang.String appId)
Set the Bing Application ID. To obtain a Bing Application ID visit http://www.bing.com/developers

Parameters:
appId - The Bing Application ID to use.

search

public BingResponse search(java.lang.String query,
                           BingRequest request)
Perform a synchronous search on the Bing API.

Parameters:
query - A string specifying the query to perform
request - A BingRequest object
Returns:
The response from the Bing API

search

public void search(java.lang.String query,
                   BingRequest request,
                   BingAsyncRequestNotification delegate)
Perform an asynchronous search on the Bing API.

Parameters:
query - A string specifying the query to perform
request - A BingRequest object
delegate - An object implementing the receiveBingResponse selector

requestUrl

public java.lang.String requestUrl(java.lang.String query,
                                   BingRequest request)
Generates the URL to use in order to query the Bing API with.

Parameters:
query - A string specifying the query to perform
request - A BingRequest object
Returns:
A string representing the URL to use in querying the Bing API

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

format

public static java.lang.String format(java.lang.String format,
                                      java.lang.Object[] args)
Internal use only, but for those who want to know it is a manual implemented java.text.MessageFormat.