net.rim.device.api.unifiedsearch
Class SearchFieldCriteria

java.lang.Object
  extended by net.rim.device.api.unifiedsearch.SearchFieldCriteria

public class SearchFieldCriteria
extends Object

Maps search keywords to specific search fields. Use this to describe the data in a SearchableEntity when you register your data in the Unified Search Framework.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

Constructor Summary
Category: Signed SearchFieldCriteria(SearchField field, String[] phrases)
          Initializes a new instance of SearchFieldCriteria.
Category: Signed SearchFieldCriteria(SearchField field, String[] phrases, boolean preserveSpecialChars, String delimiter)
          Initializes a new instance of SearchFieldCriteria.
 
Method Summary
Category: Signed  String getDelimiter()
          Returns the character sequence that delimits search keywords or phrases in this SearchFieldCriteria into multiple keywords.
Category: Signed  SearchField getField()
          Returns the SearchField instance associated with this object.
Category: Signed  String[] getPhrases()
          Returns the search phrases.
Category: Signed  boolean preserveSpecialCharacters()
          Indicates whether this SearchFieldCriteria can have keywords or phrases that contain special characters.
Category: Signed  String toString()
          Returns a String containing the search criteria.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Constructor Detail

SearchFieldCriteria

public SearchFieldCriteria(SearchField field,
                           String[] phrases)
Initializes a new instance of SearchFieldCriteria. Note that the Unified Search Framework trims leading and trailing white space in phrases. Note that for indexing purposes all strings are converted to lowercase.
NB: This constructor is the equivalent of SearchFieldCriteria(SearchField field, String[] phrases, false, null)

Parameters:
field - The SearchField instance associated with this object.
phrases - An array of String objects containing individual keywords or phrases.

Note that the framework trims leading and trailing white space in phrases. The framework combines keywords within a phrase using a logical AND operation. Search results for phrases are combined using a logical OR operation.

Throws:
IllegalArgumentException -

  • If the field parameter is null.
  • If the phrases array is null.
  • If the phrases array is empty.

    Category:
    Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
    Since:
    BlackBerry API 6.0.0

SearchFieldCriteria

public SearchFieldCriteria(SearchField field,
                           String[] phrases,
                           boolean preserveSpecialChars,
                           String delimiter)
Initializes a new instance of SearchFieldCriteria. Note that the Unified Search Service trims leading and trailing white space in phrases. Note that for indexing purposes all strings are converted to lowercase.

Parameters:
field - The SearchField instance associated with this object.
phrases - An array of String objects containing individual keywords or phrases.

Note that the framework trims leading and trailing white space in phrases. The framework combines keywords within a phrase using a logical AND operation. Search results for phrases are combined using a logical OR operation.

preserveSpecialChars - If set to true, non-alphabetic characters are not removed from keywords or phrases during indexing.
delimiter - The character sequence that the Unified Search Service should use to delimit a phrase into one or more. If this parameter is null, the entire phrase is indexed as a single keyword. If preserveSpecialChars parameter is false, delimiter is ignored.
Throws:
IllegalArgumentException -

  • If the field parameter is null.
  • If the phrases array is null.
  • If the phrases array is empty.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0


Method Detail

getField

public SearchField getField()
Returns the SearchField instance associated with this object.

Returns:
An instance of SearchField.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

getPhrases

public String[] getPhrases()
Returns the search phrases.

Returns:
An array containing the search phrases.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

toString

public String toString()
Returns a String containing the search criteria. Note: for indexing purposes all strings are converted to lowercase and thus this method will return the keywords in lowercase form.

Overrides:
toString in class Object
Returns:
A String containing the search criteria.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 6.0.0

preserveSpecialCharacters

public boolean preserveSpecialCharacters()
Indicates whether this SearchFieldCriteria can have keywords or phrases that contain special characters.

Returns:
true if special characters are preserved in the search phrases, otherwise false.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getDelimiter

public String getDelimiter()
Returns the character sequence that delimits search keywords or phrases in this SearchFieldCriteria into multiple keywords.

Returns:
The characters used to delimit the phrase, or null if not applicable.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal