Caplin Trader 4.7.1

Class: module:caplin/grid/filter/QueryFilterExpression

module:caplin/grid/filter/QueryFilterExpression

Constructor

new module:caplin/grid/filter/QueryFilterExpression()

Constructs a new QueryFilterExpression. Represents a query expression that only supports ANDing field filters and only allows a field, identified by name, to be added once. See caplin.grid.filter.QueryFilterExpression#addFilter

This object is ideal to use with web services as the caplin.grid.filter.QueryFilterExpression#toQueryString method returns a string suitable for a web service call.

Implements:

Methods

(static) clone(oQueryFilterExpression) → {module:caplin/grid/filter/QueryFilterExpression|QueryFilterExpression}

Clones the QueryFilterExpression
Parameters:
Name Type Description
oQueryFilterExpression module:caplin/grid/filter/QueryFilterExpression | QueryFilterExpression an instance of QueryFilterExpression to be cloned.
Returns:
a new instance of a QueryFilterExpression with exactly the same state as the passed oQueryFilterExpression.
Type
module:caplin/grid/filter/QueryFilterExpression | QueryFilterExpression

addFilter(sName, sValue)

Adds a filter to the expression.
Parameters:
Name Type Description
sName String The name of the filter
sValue String the value of the filter
Throws:
if a filter with that name already exists within the expression
Type
module:caplin/core/Error

clone() → {module:caplin/grid/filter/QueryFilterExpression|QueryFilterExpression}

Clones this instance of the QueryFilterExpression
Returns:
a new instance of a QueryFilterExpression with exactly the same state.
Type
module:caplin/grid/filter/QueryFilterExpression | QueryFilterExpression

getFilterExpressions()

Gets the underlying operator for this QueryFilterExpression
Returns:
The underlying LogicalFilterExpression operator

getNumberOfFilterExpressions() → {Number}

Gets the number of logical filter expressions that have been placed inside the FilterExpression.
Returns:
The Number of Filter expressions added to date.
Type
Number

getOperator()

Gets the underlying operator for this QueryFilterExpression
Returns:
The underlying LogicalFilterExpression operator

getRttpState()

Implements:
See:

getSerializedState(sIndent)

Parameters:
Name Type Description
sIndent String The number of characters the caller would like the expression to indent the XML it returns to make it easily human readable.
Implements:
See:

hasFilter(sName) → {boolean}

Checks to see if a filter with the given name already exists within the expression.
Parameters:
Name Type Description
sName String the name of the filter to check for
Returns:
true if the filter exists within the expression; otherwise false.
Type
boolean

toString() → {String}

Gets a text representation of the filter expression.
Implements:
Returns:
A text representation of the expression.
Type
String