Caplin Trader 4.7.1

Class: module:caplin/grid/filter/LogicalFilterExpression

module:caplin/grid/filter/LogicalFilterExpression

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:caplin/grid/filter/LogicalFilterExpression#addFilterExpression method will add a FilterExpression to the collection that will be evaluated by this LogicalFilterExpression.

Constructor

new module:caplin/grid/filter/LogicalFilterExpression(logicalOperator)

Constructs a new LogicalFilterExpression with the specified operator.
Parameters:
Name Type Description
logicalOperator module:caplin/grid/filter/LogicalFilterExpression/Operator The operator that determines whether this logical filter expression will perform a logical AND or OR.
Implements:
Throws:
Type
module:caplin/core/Error

Methods

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

Clones a LogicalFilterExpression
Parameters:
Name Type Description
oFilterExpression module:caplin/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:caplin/grid/filter/LogicalFilterExpression

addFilterExpression(oFilterExpression)

Adds the specified FilterExpression to this LogicalFilterExpression.
Parameters:
Name Type Description
oFilterExpression module:caplin/grid/filter/FilterExpression The expression to be added.

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

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

getFilterExpressions() → {Array}

Returns a list of the filter expressions added using module:caplin/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:caplin/grid/filter/LogicalFilterExpression/Operator}

Gets the operator for this LogicalFilterExpression
See:
Returns:
The operator for this LogicalFilterExpression
Type
module:caplin/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.
Implements:
See:
Returns:
A text representation of the expression.
Type
String