Caplin Trader 5.1.0

Class: module:ct-grid/filter/QueryFilterExpression

module:ct-grid/filter/QueryFilterExpression()

new module:ct-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 QueryFilterExpression#addFilter

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

Implements:

Methods

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

Clones the QueryFilterExpression

Parameters:
Name Type Description
oQueryFilterExpression module:ct-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:ct-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:ct-core/Error

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

Clones this instance of the QueryFilterExpression

Returns:

a new instance of a QueryFilterExpression with exactly the same state.

Type
module:ct-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.

Returns:

A text representation of the expression.

Type
String