eval method

  1. @override
Object eval(
  1. DataInstance? model,
  2. EvaluationContext context
)
override

Evaluates against model (usually the context's main instance) in context. The result is a bool, double, String, DateTime, XPathNodeset or a value returned by a custom function.

Implementation

@override
Object eval(DataInstance? model, EvaluationContext context) {
  final x = toNumeric(a.eval(model, context));
  final y = toNumeric(b.eval(model, context));
  return switch (op) {
    CmpOp.lt => x < y,
    CmpOp.gt => x > y,
    CmpOp.lte => x <= y,
    CmpOp.gte => x >= y,
  };
}