Caplin Trader 5.1.0

Class: module:ct-grid/filter/LogicalFilterExpression

module:ct-grid/filter/LogicalFilterExpression(logicalOperator)

Implementation of FilterExpression that represents how a collection of FilterExpressions should be evaluated together to determine whether a particular record matches their expectation.

The LogicalFilterExpression can either be configured to perform a logical AND or a logical OR. If a logical AND is performed then all of the expressions in the collection must be true for a record to be returned. If a logical OR is performed then at least one of the expressions in the collection must be true.

The module:ct-grid/filter/LogicalFilterExpression#addFilterExpression method will add a FilterExpression to the collection that will be evaluated by this LogicalFilterExpression.

Constructor

new module:ct-grid/filter/LogicalFilterExpression(logicalOperator)

Constructs a new LogicalFilterExpression with the specified operator.

Parameters:
Name Type Description
logicalOperator module:ct-grid/filter/LogicalFilterExpression/Operator

The operator that determines whether this logical filter expression will perform a logical AND or OR.

Implements:
Throws:

If the specified operator is not module:ct-grid/filter/LogicalFilterExpression/Operator.AND or module:ct-grid/filter/LogicalFilterExpression/Operator.OR

Type
module:ct-core/Error

Members

(static) Operator.AND :module:ct-grid/filter/LogicalFilterExpression/Operator

Represents that a logical AND will be performed by the LogicalFilterExpression. A record will only be returned if it matches all of the expressions that have been added to it.

Type:

(static) Operator.OR :module:ct-grid/filter/LogicalFilterExpression/Operator

Represents that a logical OR will be performed by the LogicalFilterExpression. A record will be returned if it matches at least one of the expressions that have been added to it.

Type:

Methods

(static) clone(oFilterExpression) → {module:ct-grid/filter/LogicalFilterExpression}

Clones a LogicalFilterExpression

Parameters:
Name Type Description
oFilterExpression module:ct-grid/filter/FilterExpression

The expression to be cloned.

Returns:

a new instance of a LogicalFilterExpression with exactly the same state as the passed oFilterExpression.

Type
module:ct-grid/filter/LogicalFilterExpression

addFilterExpression(oFilterExpression)

Adds the specified FilterExpression to this LogicalFilterExpression.

Parameters:
Name Type Description
oFilterExpression module:ct-grid/filter/FilterExpression

The expression to be added.

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

Clones this instance of the LogicalFilterExpression

See:
Returns:

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

Type
module:ct-grid/filter/LogicalFilterExpression

getFilterExpressions() → {Array}

Returns a list of the filter expressions added using module:ct-grid/filter/LogicalFilterExpression#addFilterExpression.

The array returned by this method must not be added to or removed from directly — in the future, the array returned may instead be a copy of the internally held array. Instead, the methods on this class should be used to add filter expressions.

See:
Returns:
Type
Array

getNumberOfFilterExpressions() → {Number}

Gets the number of logical filter expressions that have been placed inside the LogicalFilterExpression.

See:
Returns:

Number of Filter expressions added to date.

Type
Number

getOperator() → {module:ct-grid/filter/LogicalFilterExpression/Operator}

Gets the operator for this LogicalFilterExpression

See:
Returns:

The operator for this LogicalFilterExpression

Type
module:ct-grid/filter/LogicalFilterExpression/Operator

getRttpState() → {String}

Gets the serialized representation of this LogicalFilterExpression which is understood by the Container Filtering Module used by Transformer.

Implements:
See:
Returns:

A serialized representation of this expression.

Type
String

getSerializedState(sIndent) → {String}

Gets the XML representation of this LogicalFilterExpression that will be used to save it within a serialized component and/or layout.

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:
Returns:

An XML representation of this expression.

Type
String

toMap()

Construct map representing the filter

Implements:

toString() → {String}

Gets a text representation of the logical filter expression.

See:
Returns:

A text representation of the expression.

Type
String