protected override ExprEvaluator ValidateAll(
            string lhsName,
            IList<ExprNode> lhs,
            string rhsName,
            IList<ExprNode> rhs,
            ExprValidationContext validationContext)
        {
            EPLValidationUtil.ValidateParameterNumber(lhsName, LHS_VALIDATION_NAME, false, 4, lhs.Count);
            EPLValidationUtil.ValidateParametersTypePredefined(lhs, lhsName, LHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            EPLValidationUtil.ValidateParameterNumber(rhsName, RHS_VALIDATION_NAME, true, 4, rhs.Count);
            EPLValidationUtil.ValidateParametersTypePredefined(rhs, rhsName, RHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            var meXEval = lhs[0].ExprEvaluator;
            var meYEval = lhs[1].ExprEvaluator;
            var meWidthEval = lhs[2].ExprEvaluator;
            var meHeightEval = lhs[3].ExprEvaluator;

            var otherXEval = rhs[0].ExprEvaluator;
            var otherYEval = rhs[1].ExprEvaluator;
            var otherWidthEval = rhs[2].ExprEvaluator;
            var otherHeightEval = rhs[3].ExprEvaluator;
            return new RectangleIntersectsRectangleEvaluator(meXEval, meYEval, meWidthEval, meHeightEval, otherXEval,
                otherYEval, otherWidthEval, otherHeightEval);
        }
Esempio n. 2
0
        protected override ExprForge ValidateAll(
            string lhsName,
            ExprNode[] lhs,
            string rhsName,
            ExprNode[] rhs,
            ExprValidationContext validationContext)
        {
            EPLValidationUtil.ValidateParameterNumber(lhsName, LHS_VALIDATION_NAME, false, 2, lhs.Length);
            EPLValidationUtil.ValidateParametersTypePredefined(
                lhs,
                lhsName,
                LHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            EPLValidationUtil.ValidateParameterNumber(rhsName, RHS_VALIDATION_NAME, true, 4, rhs.Length);
            EPLValidationUtil.ValidateParametersTypePredefined(
                rhs,
                rhsName,
                RHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            ExprForge pxEval = lhs[0].Forge;
            ExprForge pyEval = lhs[1].Forge;
            ExprForge xEval = rhs[0].Forge;
            ExprForge yEval = rhs[1].Forge;
            ExprForge widthEval = rhs[2].Forge;
            ExprForge heightEval = rhs[3].Forge;
            return new PointIntersectsRectangleForge(parent, pxEval, pyEval, xEval, yEval, widthEval, heightEval);
        }
        protected override ExprForge ValidateAll(
            string lhsName,
            ExprNode[] lhs,
            string rhsName,
            ExprNode[] rhs,
            ExprValidationContext validationContext)
        {
            EPLValidationUtil.ValidateParameterNumber(lhsName, LHS_VALIDATION_NAME, false, 4, lhs.Length);
            EPLValidationUtil.ValidateParametersTypePredefined(
                lhs,
                lhsName,
                LHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            EPLValidationUtil.ValidateParameterNumber(rhsName, RHS_VALIDATION_NAME, true, 4, rhs.Length);
            EPLValidationUtil.ValidateParametersTypePredefined(
                rhs,
                rhsName,
                RHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            var meXEval = lhs[0].Forge;
            var meYEval = lhs[1].Forge;
            var meWidthEval = lhs[2].Forge;
            var meHeightEval = lhs[3].Forge;

            var otherXEval = rhs[0].Forge;
            var otherYEval = rhs[1].Forge;
            var otherWidthEval = rhs[2].Forge;
            var otherHeightEval = rhs[3].Forge;
            return new RectangleIntersectsRectangleForge(
                parent,
                meXEval,
                meYEval,
                meWidthEval,
                meHeightEval,
                otherXEval,
                otherYEval,
                otherWidthEval,
                otherHeightEval);
        }
        protected override ExprEvaluator ValidateAll(
            string lhsName,
            IList<ExprNode> lhs,
            string rhsName,
            IList<ExprNode> rhs,
            ExprValidationContext validationContext)
        {
            EPLValidationUtil.ValidateParameterNumber(lhsName, LHS_VALIDATION_NAME, false, 2, lhs.Count);
            EPLValidationUtil.ValidateParametersTypePredefined(lhs, lhsName, LHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            EPLValidationUtil.ValidateParameterNumber(rhsName, RHS_VALIDATION_NAME, true, 4, rhs.Count);
            EPLValidationUtil.ValidateParametersTypePredefined(rhs, rhsName, RHS_VALIDATION_NAME,
                EPLExpressionParamType.NUMERIC);

            var pxEval = lhs[0].ExprEvaluator;
            var pyEval = lhs[1].ExprEvaluator;
            var xEval = rhs[0].ExprEvaluator;
            var yEval = rhs[1].ExprEvaluator;
            var widthEval = rhs[2].ExprEvaluator;
            var heightEval = rhs[3].ExprEvaluator;
            return new PointIntersectsRectangleEvaluator(pxEval, pyEval, xEval, yEval, widthEval, heightEval);
        }