๐Ÿ”„Condition and ConsRepo

Function and Usage

Condition Object is a data structure specially used for comparison and boolean operation. It can store up to 3 comparison parameters and compare 3 sets of data simultaneously, and then perform boolean operation on the comparison results in accordance with the predefined logic, so as to realize and check the complex triggering conditions.

Members and Attributes

The main members of the conditions repo are the comparison objects and the Comparison mapping which with the structure of "Number -> Comparison Objects".

Comparison Objects

Attributes List of Comparison Objects

AttributeCommercial and Legal Meaning

seqOfCond

Condition object number.

logicOpr

Logical operator (see below).

compOpr1

Comparison operator-1 (see below).

para1

Comparison parameter-1.

compOpr2

Comparison operator-2.

para2

Comparison parameter-2.

compOpr3

Comparison operator-3.

para3

Comparison parameter-3.

Value Meaning of Logical Operator Attribute

ValueMeaning

1

And๏ผˆa && b๏ผ‰

2

Or๏ผˆa || b๏ผ‰

3

Equal to๏ผˆa == b๏ผ‰

4

Unequal to๏ผˆa != b๏ผ‰

5

And twice๏ผˆ a && b && c ๏ผ‰

6

Or twice๏ผˆa || b || c๏ผ‰

7

And & Or๏ผˆa && b || c๏ผ‰

8

Or & And๏ผˆa || b && c๏ผ‰

9

Equal to twice๏ผˆa == b == c๏ผ‰

10

Unequal to twice๏ผˆa != b != c๏ผ‰

11

Equal to & Unequal to๏ผˆa == b != c๏ผ‰

12

Unequal toใ€Equal to๏ผˆa != b == c๏ผ‰

13

And & Equal to๏ผˆa && b == c๏ผ‰

14

Equal to & And๏ผˆa == b && c๏ผ‰

15

Or & Equal to๏ผˆa || b == c๏ผ‰

16

Equal to & Or๏ผˆa == b || c๏ผ‰

17

Or& Unequal to๏ผˆa && b != c๏ผ‰

18

Unequal to & Or๏ผˆa != b && c๏ผ‰

19

Or & Unequal to๏ผˆa || b != c๏ผ‰

20

Unequal to & Or๏ผˆa != b || c๏ผ‰

Value Meaning of Comparison Operator Attribute

ValueMeaning

1

Equal to ๏ผˆa == b๏ผ‰

2

Unequal to (a != b)

3

More (a > b)

4

Less๏ผˆa < b๏ผ‰

5

More & Equal to๏ผˆa >= b๏ผ‰

6

Less& Equal to๏ผˆa <= b๏ผ‰

Query API

The query API well describes the function and usage of the Conditions repo in the whole system, as shown in the table below.

API Commercial and Legal Meaning

counterOfConds

Get the current value of the condition object counter.

getConds

Get a list of all condition objects.

checkCond

Query whether the input data satisfies a comparison condition consisting of a specific comparison operator (compOpr) and a comparison threshold (para).

checkSoleCond

Query whether the input data (data) satisfies the single comparison operation condition specified in the Condition object (Cond).

checkCondsOfTwo

Query whether the input two data (data1 and data2) satisfy the triggering conditions defined jointly by two comparison operations and Boolean operators specified by the Condition object (Cond).

checkCondsOfThree

Query whether the input three data (data1, data2 and data3) satisfy the triggering condition defined by the condition object (Cond) with the three comparison operations and boolean operators.

Source Code

Last updated