expression

< Back


NotEqual

Namespace: Albatross.Expression.Infix

Infix expression that performs not-equal comparison between two operands. Uses the “<>” operator with precedence 50.

public class NotEqual : ComparisonInfixOperation, Albatross.Expression.Nodes.IInfixExpression, Albatross.Expression.Nodes.IExpression, Albatross.Expression.Nodes.IToken, Albatross.Expression.Nodes.IHasPrecedence

Inheritance ObjectInfixExpressionComparisonInfixOperationNotEqual
Implements IInfixExpression, IExpression, IToken, IHasPrecedence

Properties

Operator

The operator symbol for this infix operation.

public string Operator { get; }

Property Value

String

Token

The token representation, which is the same as the Operator.

public string Token { get; }

Property Value

String

Precedence

The precedence level of this operation for proper evaluation order.

public int Precedence { get; }

Property Value

Int32

Left

The left operand of the infix operation.

public IExpression Left { get; set; }

Property Value

IExpression

The right operand of the infix operation.

public IExpression Right { get; set; }

Property Value

IExpression

RequiredLeft

Gets the required left operand, throwing an exception if it’s null.

public IExpression RequiredLeft { get; }

Property Value

IExpression

RequiredRight

Gets the required right operand, throwing an exception if it’s null.

public IExpression RequiredRight { get; }

Property Value

IExpression

Constructors

NotEqual()

Initializes a new instance of the NotEqual class with operator “<>” and precedence 50.

public NotEqual()

Methods

Interpret(Int32)

Interprets the comparison result to determine if the operands are not equal.

public bool Interpret(int comparisonResult)

Parameters

comparisonResult Int32
The result from comparing the operands (-1, 0, or 1).

Returns

Boolean
true if the operands are not equal (comparison result is not 0); otherwise, false.


< Back