© 2004 BEA Systems, Inc.

com.bea.query
Class QueryRequest

java.lang.Object
  extended bycom.bea.query.QueryRequest
All Implemented Interfaces:
Serializable

public class QueryRequest
extends Object
implements Serializable

The QueryRequest class is used to generate a query to the Autonomy DRE.

See Also:
Serialized Form

Constructor Summary
QueryRequest()
          Default constructor does nothing.
 
Method Summary
 void addSearchDatabase(String dbName)
          Add a search database in the DRE to query.
 void clearSearchDatabases()
          Remove all databases from this QueryRequest.
 Iterator getDatabases()
          Get an Iterator over the databases listed.
 Integer getMaximumNumberOfResults()
          Get the maximum number of results for the DRE to return.
 String getQueryText()
          Gets the current query text.
 Double getThreshold()
          Gets the current threshold value.
 void setMaximumNumberOfResults(int num)
          The number of results returned.
 void setMaximumNumberOfResults(Integer num)
          A convience method for setting the number of returned results with an Integer.
 void setQueryText(String text)
          Sets the query string to be sent to the Autonomy DRE.
 void setThreshold(double thold)
          The threshold is a number from 0 (zero) to 100 that is assigned to each result by the DRE.
 void setThreshold(Double thold)
          A convience method to set the threshold with a Double value.
 String toString()
          Print out the contents of this QueryRequest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryRequest

public QueryRequest()
Default constructor does nothing.

Method Detail

addSearchDatabase

public void addSearchDatabase(String dbName)
Add a search database in the DRE to query. No verification is done on the database name by this class to make sure it is valid in the DRE.

Parameters:
dbName - the name of the database to add to the QueryRequest.

clearSearchDatabases

public void clearSearchDatabases()
Remove all databases from this QueryRequest.


getDatabases

public Iterator getDatabases()
Get an Iterator over the databases listed. This Iterator will not be null but may be empty.

Returns:
an Iterator over the database list. The list will contain all Strings.

getMaximumNumberOfResults

public Integer getMaximumNumberOfResults()
Get the maximum number of results for the DRE to return.

Returns:
the maximum number of results. This value may be null.

getQueryText

public String getQueryText()
Gets the current query text.

Returns:
the query text

getThreshold

public Double getThreshold()
Gets the current threshold value.

Returns:
the threshold value. This may be null.

setMaximumNumberOfResults

public void setMaximumNumberOfResults(int num)
The number of results returned. Any particular search may have many more than this number but the DRE only sends this amount back. The DRE defaults this value to one but this class has no default.

Parameters:
num - the integer number of results to return

setMaximumNumberOfResults

public void setMaximumNumberOfResults(Integer num)
A convience method for setting the number of returned results with an Integer.

Parameters:
num - the Integer number of results to return.

setQueryText

public void setQueryText(String text)
Sets the query string to be sent to the Autonomy DRE. This string is a "natural text" string but will also handle simple keyword searches. There are no predefined delimiters.

Parameters:
text - the query text to be used

setThreshold

public void setThreshold(double thold)
                  throws IllegalArgumentException
The threshold is a number from 0 (zero) to 100 that is assigned to each result by the DRE. No results under this number will be returned.

Parameters:
thold - the double threshold value
Throws:
an - IllegalArgumentException if the value falls outside the acceptable range.
IllegalArgumentException

setThreshold

public void setThreshold(Double thold)
                  throws IllegalArgumentException
A convience method to set the threshold with a Double value.

Parameters:
thold - the Double threshold value
Throws:
an - IllegalArgumentException if the value falls outside the acceptable range.
IllegalArgumentException

toString

public String toString()
Print out the contents of this QueryRequest. This is mostly used for debugging.

Returns:
a debug version of the QueryRequest

© 2004 BEA Systems, Inc.

Copyright © 2004 BEA Systems, Inc. All Rights Reserved