예제 #1
0
 public AstDerivativeOrIntegralWindowExpression(AstDerivativeOrIntegralWindowOperator @operator, AstExpression arg, WindowTimeUnit?unit, AstWindow window)
 {
     _operator = @operator;
     _arg      = Ensure.IsNotNull(arg, nameof(arg));
     _unit     = unit;
     _window   = window;
 }
 public static string Render(this AstDerivativeOrIntegralWindowOperator @operator)
 {
     return(@operator switch
     {
         AstDerivativeOrIntegralWindowOperator.Derivative => "$derivative",
         AstDerivativeOrIntegralWindowOperator.Integral => "$integral",
         _ => throw new InvalidOperationException($"Unexpected derivative or integral window operator: {@operator}.")
     });
예제 #3
0
        public AstDerivativeOrIntegralWindowExpression Update(AstDerivativeOrIntegralWindowOperator @operator, AstExpression arg, WindowTimeUnit?unit, AstWindow window)
        {
            if (@operator == _operator && arg == _arg && unit == _unit && window == _window)
            {
                return(this);
            }

            return(new AstDerivativeOrIntegralWindowExpression(@operator, arg, unit, window));
        }