Package com.espertech.esper.type

Examples of com.espertech.esper.type.RelationalOpEnum


        if (!(constituent instanceof ExprRelationalOpNode)) {
            return op;
        }

        ExprRelationalOpNode relNode = (ExprRelationalOpNode) constituent;
        RelationalOpEnum relationalOpEnum = relNode.getRelationalOpEnum();

        if (relationalOpEnum == RelationalOpEnum.GT)
        {
            return FilterOperator.LESS;
        }
View Full Code Here


        else if (expr instanceof SubqueryQualifiedExpression)
        {
            SubqueryQualifiedExpression sub = (SubqueryQualifiedExpression) expr;
            StatementSpecRaw rawSubselect = map(sub.getModel(), mapContext);
            boolean isNot = false;
            RelationalOpEnum relop = null;
            if (sub.getOperator().equals("!="))
            {
                isNot = true;
            }
            if (sub.getOperator().equals("="))
View Full Code Here

        else if (expr instanceof SubqueryQualifiedExpression)
        {
            SubqueryQualifiedExpression sub = (SubqueryQualifiedExpression) expr;
            StatementSpecRaw rawSubselect = map(sub.getModel(), mapContext);
            boolean isNot = false;
            RelationalOpEnum relop = null;
            if (sub.getOperator().equals("!="))
            {
                isNot = true;
            }
            if (sub.getOperator().equals("="))
View Full Code Here

            }
        }
        else if (currentMethod == DatetimeMethodEnum.DURING || currentMethod == DatetimeMethodEnum.INCLUDES) {
            // DURING:   b.startTimestamp < a.startTimestamp <= a.endTimestamp < b.endTimestamp
            // INCLUDES: a.startTimestamp < b.startTimestamp <= b.endTimestamp < a.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.DURING ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
                    targetStreamNum, targetStartProp, targetStartExpr,
                    relop);

            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    relop);
        }
        else if (currentMethod == DatetimeMethodEnum.FINISHES || currentMethod == DatetimeMethodEnum.FINISHEDBY) {
            // FINISHES:   b.startTimestamp < a.startTimestamp and a.endTimestamp = b.endTimestamp
            // FINISHEDBY: a.startTimestamp < b.startTimestamp and a.endTimestamp = b.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.FINISHES ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
                    targetStreamNum, targetStartProp, targetStartExpr,
                    relop);

            queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.MEETS) {
            // a.endTimestamp = b.startTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.METBY) {
            // a.startTimestamp = b.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.OVERLAPS || currentMethod == DatetimeMethodEnum.OVERLAPPEDBY) {
            // OVERLAPS:     a.startTimestamp < b.startTimestamp < a.endTimestamp < b.endTimestamp
            // OVERLAPPEDBY: b.startTimestamp < a.startTimestamp < b.endTimestamp < a.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.OVERLAPS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr,
                    relop);

            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    relop);

            if (currentMethod == DatetimeMethodEnum.OVERLAPS) {
                queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
                        targetStreamNum, targetEndProp, targetEndExpr,
                        RelationalOpEnum.LT);
            }
            else {
                queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
                        parameterStreamNum, parameterEndProp, parameterEndExpr,
                        RelationalOpEnum.LT);
            }
        }
        else if (currentMethod == DatetimeMethodEnum.STARTS || currentMethod == DatetimeMethodEnum.STARTEDBY) {
            // STARTS:       a.startTimestamp = b.startTimestamp and a.endTimestamp < b.endTimestamp
            // STARTEDBY:    a.startTimestamp = b.startTimestamp and b.endTimestamp < a.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);

            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.STARTS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    relop);
        }
    }
View Full Code Here

        }

        int indexedStream = -1;
        ExprIdentNode indexedPropExpr = null;
        ExprNode exprNodeNoIdent = null;
        RelationalOpEnum relop = relNode.getRelationalOpEnum();

        if (relNode.getChildNodes()[0] instanceof ExprIdentNode) {
            indexedPropExpr = (ExprIdentNode) relNode.getChildNodes()[0];
            indexedStream = indexedPropExpr.getStreamId();
            exprNodeNoIdent = relNode.getChildNodes()[1];
        }
        else if (relNode.getChildNodes()[1] instanceof ExprIdentNode) {
            indexedPropExpr = (ExprIdentNode) relNode.getChildNodes()[1];
            indexedStream = indexedPropExpr.getStreamId();
            exprNodeNoIdent = relNode.getChildNodes()[0];
            relop = relop.reversed();
        }
        if (indexedStream == -1) {
            return;     // require property of right/left side of equals
        }
View Full Code Here

            }
        }
        else if (currentMethod == DatetimeMethodEnum.DURING || currentMethod == DatetimeMethodEnum.INCLUDES) {
            // DURING:   b.startTimestamp < a.startTimestamp <= a.endTimestamp < b.endTimestamp
            // INCLUDES: a.startTimestamp < b.startTimestamp <= b.endTimestamp < a.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.DURING ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartExpr,
                    targetStreamNum, targetStartExpr,
                    relop);

            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndExpr,
                    parameterStreamNum, parameterEndExpr,
                    relop);
        }
        else if (currentMethod == DatetimeMethodEnum.FINISHES || currentMethod == DatetimeMethodEnum.FINISHEDBY) {
            // FINISHES:   b.startTimestamp < a.startTimestamp and a.endTimestamp = b.endTimestamp
            // FINISHEDBY: a.startTimestamp < b.startTimestamp and a.endTimestamp = b.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.FINISHES ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartExpr,
                    targetStreamNum, targetStartExpr,
                    relop);

            queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.MEETS) {
            // a.endTimestamp = b.startTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.METBY) {
            // a.startTimestamp = b.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.OVERLAPS || currentMethod == DatetimeMethodEnum.OVERLAPPEDBY) {
            // OVERLAPS:     a.startTimestamp < b.startTimestamp < a.endTimestamp < b.endTimestamp
            // OVERLAPPEDBY: b.startTimestamp < a.startTimestamp < b.endTimestamp < a.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.OVERLAPS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(targetStreamNum, targetStartExpr,
                    parameterStreamNum, parameterStartExpr,
                    relop);

            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndExpr,
                    parameterStreamNum, parameterEndExpr,
                    relop);

            if (currentMethod == DatetimeMethodEnum.OVERLAPS) {
                queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartExpr,
                        targetStreamNum, targetEndExpr,
                        RelationalOpEnum.LT);
            }
            else {
                queryGraph.addRelationalOpStrict(targetStreamNum, targetStartExpr,
                        parameterStreamNum, parameterEndExpr,
                        RelationalOpEnum.LT);
            }
        }
        else if (currentMethod == DatetimeMethodEnum.STARTS || currentMethod == DatetimeMethodEnum.STARTEDBY) {
            // STARTS:       a.startTimestamp = b.startTimestamp and a.endTimestamp < b.endTimestamp
            // STARTEDBY:    a.startTimestamp = b.startTimestamp and b.endTimestamp < a.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);

            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.STARTS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndExpr,
                    parameterStreamNum, parameterEndExpr,
                    relop);
        }
    }
View Full Code Here

        else if (expr instanceof SubqueryQualifiedExpression)
        {
            SubqueryQualifiedExpression sub = (SubqueryQualifiedExpression) expr;
            StatementSpecRaw rawSubselect = map(sub.getModel(), mapContext);
            boolean isNot = false;
            RelationalOpEnum relop = null;
            if (sub.getOperator().equals("!="))
            {
                isNot = true;
            }
            if (sub.getOperator().equals("="))
View Full Code Here

        else if (expr instanceof SubqueryQualifiedExpression)
        {
            SubqueryQualifiedExpression sub = (SubqueryQualifiedExpression) expr;
            StatementSpecRaw rawSubselect = map(sub.getModel(), mapContext);
            boolean isNot = false;
            RelationalOpEnum relop = null;
            if (sub.getOperator().equals("!="))
            {
                isNot = true;
            }
            if (sub.getOperator().equals("="))
View Full Code Here

        }

        int indexedStream = -1;
        String indexedProp = null;
        ExprNode exprNodeNoIdent = null;
        RelationalOpEnum relop = relNode.getRelationalOpEnum();

        if (relNode.getChildNodes()[0] instanceof ExprIdentNode) {
            ExprIdentNode identNode = (ExprIdentNode) relNode.getChildNodes()[0];
            indexedStream = identNode.getStreamId();
            indexedProp = identNode.getResolvedPropertyName();
            exprNodeNoIdent = relNode.getChildNodes()[1];
        }
        else if (relNode.getChildNodes()[1] instanceof ExprIdentNode) {
            ExprIdentNode identNode = (ExprIdentNode) relNode.getChildNodes()[1];
            indexedStream = identNode.getStreamId();
            indexedProp = identNode.getResolvedPropertyName();
            exprNodeNoIdent = relNode.getChildNodes()[0];
            relop = relop.reversed();
        }
        if (indexedStream == -1) {
            return;     // require property of right/left side of equals
        }
View Full Code Here

            }
        }
        else if (currentMethod == DatetimeMethodEnum.DURING || currentMethod == DatetimeMethodEnum.INCLUDES) {
            // DURING:   b.startTimestamp < a.startTimestamp <= a.endTimestamp < b.endTimestamp
            // INCLUDES: a.startTimestamp < b.startTimestamp <= b.endTimestamp < a.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.DURING ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
                    targetStreamNum, targetStartProp, targetStartExpr,
                    relop);

            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    relop);
        }
        else if (currentMethod == DatetimeMethodEnum.FINISHES || currentMethod == DatetimeMethodEnum.FINISHEDBY) {
            // FINISHES:   b.startTimestamp < a.startTimestamp and a.endTimestamp = b.endTimestamp
            // FINISHEDBY: a.startTimestamp < b.startTimestamp and a.endTimestamp = b.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.FINISHES ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
                    targetStreamNum, targetStartProp, targetStartExpr,
                    relop);

            queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.MEETS) {
            // a.endTimestamp = b.startTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.METBY) {
            // a.startTimestamp = b.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr);
        }
        else if (currentMethod == DatetimeMethodEnum.OVERLAPS || currentMethod == DatetimeMethodEnum.OVERLAPPEDBY) {
            // OVERLAPS:     a.startTimestamp < b.startTimestamp < a.endTimestamp < b.endTimestamp
            // OVERLAPPEDBY: b.startTimestamp < a.startTimestamp < b.endTimestamp < a.endTimestamp
            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.OVERLAPS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr,
                    relop);

            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    relop);

            if (currentMethod == DatetimeMethodEnum.OVERLAPS) {
                queryGraph.addRelationalOpStrict(parameterStreamNum, parameterStartProp, parameterStartExpr,
                        targetStreamNum, targetEndProp, targetEndExpr,
                        RelationalOpEnum.LT);
            }
            else {
                queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
                        parameterStreamNum, parameterEndProp, parameterEndExpr,
                        RelationalOpEnum.LT);
            }
        }
        else if (currentMethod == DatetimeMethodEnum.STARTS || currentMethod == DatetimeMethodEnum.STARTEDBY) {
            // STARTS:       a.startTimestamp = b.startTimestamp and a.endTimestamp < b.endTimestamp
            // STARTEDBY:    a.startTimestamp = b.startTimestamp and b.endTimestamp < a.endTimestamp
            queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
                    parameterStreamNum, parameterStartProp, parameterStartExpr);

            RelationalOpEnum relop = currentMethod == DatetimeMethodEnum.STARTS ? RelationalOpEnum.LT : RelationalOpEnum.GT;
            queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
                    parameterStreamNum, parameterEndProp, parameterEndExpr,
                    relop);
        }
    }
View Full Code Here

TOP

Related Classes of com.espertech.esper.type.RelationalOpEnum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.