Examples of ArithmeticOperand


Examples of org.modeshape.jcr.query.model.ArithmeticOperand

    public static DynamicOperand replaceAliasesWithProperties( QueryContext context,
                                                               DynamicOperand operand,
                                                               Map<String, String> propertyByAlias ) {
        if (operand instanceof ArithmeticOperand) {
            ArithmeticOperand arith = (ArithmeticOperand)operand;
            DynamicOperand newLeft = replaceAliasesWithProperties(context, arith.getLeft(), propertyByAlias);
            DynamicOperand newRight = replaceAliasesWithProperties(context, arith.getRight(), propertyByAlias);
            if (newLeft == arith.getLeft() && newRight == arith.getRight()) return arith;
            return new ArithmeticOperand(newLeft, arith.operator(), newRight);
        }
        if (operand instanceof FullTextSearchScore) {
            return operand;
        }
        if (operand instanceof Length) {
View Full Code Here

Examples of org.modeshape.jcr.query.model.ArithmeticOperand

        protected ComparisonBuilder comparisonBuilder( DynamicOperand right ) {
            DynamicOperand leftOperand = null;
            // If the left operand is an arithmetic operand, then we need to check the operator precedence ...
            if (left instanceof ArithmeticOperand) {
                ArithmeticOperand leftArith = (ArithmeticOperand)left;
                ArithmeticOperator operator = leftArith.operator();
                if (this.operator.precedes(operator)) {
                    // Need to do create an operand with leftArith.right and right
                    DynamicOperand inner = new ArithmeticOperand(leftArith.getRight(), this.operator, right);
                    leftOperand = new ArithmeticOperand(leftArith.getLeft(), operator, inner);
                } else {
                    // the left preceds this, so we can add the new operand on top ...
                    leftOperand = new ArithmeticOperand(leftArith, operator, right);
                }
            } else {
                // The left isn't an arith ...
                leftOperand = new ArithmeticOperand(left, operator, right);
            }
            return new ComparisonBuilder(comparisonBuilder.constraintBuilder, leftOperand);
        }
View Full Code Here

Examples of org.modeshape.jcr.query.model.ArithmeticOperand

            // } else if (operand instanceof NodeName) {
            // NodeName depth = (NodeName)operand;
            // verifyOrdering(depth.selectorName(), "jcr:name");
        } else if (operand instanceof ArithmeticOperand) {
            // The LEFT and RIGHT dynamic operands must both work with this operator ...
            ArithmeticOperand arith = (ArithmeticOperand)operand;
            verifyOrdering(arith.getLeft());
            verifyOrdering(arith.getRight());
        }
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.ArithmeticOperand

            // } else if (operand instanceof NodeName) {
            // NodeName depth = (NodeName)operand;
            // verifyOperator(depth.selectorName(), "jcr:name", op);
        } else if (operand instanceof ArithmeticOperand) {
            // The LEFT and RIGHT dynamic operands must both work with this operator ...
            ArithmeticOperand arith = (ArithmeticOperand)operand;
            verifyComparison(arith.getLeft(), op, rhs);
            verifyComparison(arith.getRight(), op, rhs);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.