Find FilterExpression

The FilterExpression object represents the expression that is used to find an item that matches its defined condition.


Supported Platform(s)

- BlackBerry OS 5.0+
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
blackberry.phone.Find.FilterExpression Y Y Y      Y
leftField Y Y Y      Y
negate Y Y Y      Y
operator Y Y Y      Y
rightField Y Y Y      Y

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

You must declare the feature element(s) below in your configuration document:

Feature IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.phone.Find" /> Y Y Y      Y

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.


Properties

Object leftField
Boolean negate
Object operator
Object rightField

Constructors

blackberry.phone.Find.FilterExpression (leftField : Object, operator : Object, rightField : Object, [negate : Boolean])

The FilterExpression object is an instance object, where if a new instance is desired, it must be created using the new keyword.


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator


Parameters
leftField An object of String or FilterExpression class.
operator The operator used for comparing or combining.
rightField A value to be compared, or an object of the FilterExpression class, to be combined.
negate optional (default value is false), the flag that indicates whether the condition of the FilterExpression object should be evaluated negatively.

Code Example:
<script type="text/javascript">
  // Create simple filters and combine them with AND operator
  var filter1 = new blackberry.phone.Find.FilterExpression("date.Hour", ">", 17);
  var filter2 = new blackberry.phone.Find.FilterExpression("duration", "<=", 100);
  var filterAND = new blackberry.phone.Find.FilterExpression(filter1, "AND", filter2);
</script>

Properties

readonly Object leftField


1. (Either) contains the interested field for "Find." It also supports the JAM predefined fields for the attribute of Date type (using "."), so the user can "find" towards a date attribute to match the searching criteria.

For example, for a find towards call log date attribute with the Date of "Dec. 4, 2008 16:30:00"
date.Year - returns a string of 4 digits of the Year value of the date attribute: "2008"
date.Month - returns a string of the Month value: "12"
date.Day - returns a string of the Date value: "4"
date.Hour - returns a string of the Hour value: "16"
date.Minute - returns a string of the Minute value: "30"
date.Second - returns a string of the Second value: "00"

2. (Or) contains another FilterExpression object to be combined with "rightField."


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

readonly Boolean negate


The Boolean flag that indicates whether the condition of the FilterExpression object should be evaluated negatively. This should only be used when you have nested expressions. On regular field/value comparisons, negate isn't necessary as the != is sufficient.


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

readonly Object operator


Contains the operator, which is either an integer or a string, used for comparing or combining:
0, "!=" - Not equal
1, "==" - Equal
2, "<" - Less than
4, ">" - Greater than
3, "<=" - Equal | Less than (Less or Equal)
5, ">=" - Equal | Greater than (Greater or Equal)
8, "AND" - AND
16, "OR" - OR
32, "CONTAINS" - CONTAINS


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

readonly Object rightField


1. (Either) contains the value that used for comparing with the field that is specified by "leftField (see details for the leftField)."
2. (Or) contains another FilterExpression object to be combined with "leftField."


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:38 GMT-0500 (EST)