Class ComparisonInfixOperation
- Namespace
- Albatross.Expression.Infix
- Assembly
- Albatross.Expression.dll
Base class for infix operations that perform comparison between two operands of the same type.
public abstract class ComparisonInfixOperation : InfixExpression, IInfixExpression, IExpression, IToken, IHasPrecedence
- Inheritance
-
ComparisonInfixOperation
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ComparisonInfixOperation(string, int)
Initializes a new instance of the ComparisonInfixOperation class.
protected ComparisonInfixOperation(string operatorSymbol, int precedence)
Parameters
operatorSymbolstringThe operator symbol for this comparison.
precedenceintThe precedence level for this operation.
Methods
Interpret(int)
Interprets the result of the comparison operation.
public abstract bool Interpret(int comparisonResult)
Parameters
comparisonResultintThe result from the comparison (-1, 0, or 1).
Returns
- bool
True if the comparison satisfies the operation's condition; otherwise, false.
Run(object, object)
Executes the infix operation with the evaluated left and right operands. Derived classes should override this method to implement specific operations.
protected override object Run(object left, object right)
Parameters
Returns
- object
The result of the operation.