ComparisonEvaluator class

Comparison operators. A comparison operator returns false if the comparison is false, or there is an error. This prevents errors from short-circuiting boolean expressions.

Extends

Constructors

ComparisonEvaluator(string, (arg0: any[]) => boolean, ValidateExpressionDelegate, VerifyExpression)

Initializes a new instance of the ComparisonEvaluator class.

Properties

negation

Gets the evaluator that is a negation of this one. Sets the evaluator that is a negation of this one.

Inherited Properties

returnType

Type expected by evaluating the expression.

type

Gets the expression type for evaluator.

Inherited Methods

tryEvaluate(Expression, MemoryInterface, Options)

Evaluate an expression.

validateExpression(Expression)

Validate an expression.

Constructor Details

ComparisonEvaluator(string, (arg0: any[]) => boolean, ValidateExpressionDelegate, VerifyExpression)

Initializes a new instance of the ComparisonEvaluator class.

new ComparisonEvaluator(type: string, func: (arg0: any[]) => boolean, validator: ValidateExpressionDelegate, verify?: VerifyExpression)

Parameters

type

string

Name of the built-in function.

func

(arg0: any[]) => boolean

The comparison function, it takes a list of objects and returns a boolean.

validator
ValidateExpressionDelegate

(xref:adaptive-expressions.ValidateExpressionDelegate) for input arguments.

verify
VerifyExpression

Optional. VerifyExpression function to verify each child's result.

Property Details

negation

Gets the evaluator that is a negation of this one. Sets the evaluator that is a negation of this one.

ExpressionEvaluator negation

Property Value

The evaluator that is a negation of this one.

Inherited Property Details

returnType

Type expected by evaluating the expression.

returnType: ReturnType

Property Value

Inherited From ExpressionEvaluator.returnType

type

Gets the expression type for evaluator.

type: string

Property Value

string

Inherited From ExpressionEvaluator.type

Inherited Method Details

tryEvaluate(Expression, MemoryInterface, Options)

Evaluate an expression.

function tryEvaluate(expression: Expression, state: MemoryInterface, options: Options): ValueWithError

Parameters

expression
Expression

Expression to evaluate.

state
MemoryInterface

Global state information.

options
Options

Options used in the evaluation.

Returns

The value and error string that is non-null if there is an error.

Inherited From ExpressionEvaluator.tryEvaluate

validateExpression(Expression)

Validate an expression.

function validateExpression(expression: Expression)

Parameters

expression
Expression

Expression to validate.

Inherited From ExpressionEvaluator.validateExpression