Examples of operator()


Examples of org.modeshape.jcr.query.model.ArithmeticOperand.operator()

                                                        PlanNode node ) {
        if (operand instanceof ArithmeticOperand) {
            ArithmeticOperand arith = (ArithmeticOperand)operand;
            DynamicOperand newLeft = replaceViewReferences(context, arith.getLeft(), mapping, node);
            DynamicOperand newRight = replaceViewReferences(context, arith.getRight(), mapping, node);
            return new ArithmeticOperand(newLeft, arith.operator(), newRight);
        }
        if (operand instanceof FullTextSearchScore) {
            FullTextSearchScore score = (FullTextSearchScore)operand;
            if (!mapping.getOriginalName().equals(score.selectorName())) return score;
            if (mapping.isMappedToSingleSelector()) {
View Full Code Here

Examples of org.modeshape.jcr.query.model.ArithmeticOperand.operator()

        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 {
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

        assertThat(newSelect.getType(), is(Type.SELECT));
        assertThat(newSelect.getSelectors(), is(access.getSelectors()));
        assertThat(newSelect.getParent(), is(sameInstance(project)));
        Comparison equality = newSelect.getProperty(Property.SELECT_CRITERIA, Comparison.class);
        assertThat(equality.getOperand1(), is(select2.getProperty(Property.SELECT_CRITERIA, Comparison.class).getOperand1()));
        assertThat(equality.operator(), is(Operator.EQUAL_TO));
        assertThat(equality.getOperand2(), is(select2.getProperty(Property.SELECT_CRITERIA, Comparison.class).getOperand2()));
        assertChildren(newSelect, select1);
        assertChildren(select1, source);
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

            for (PlanNode select : access.findAllAtOrBelow(Type.SELECT)) {
                Constraint constraint = select.getProperty(Property.SELECT_CRITERIA, Constraint.class);
                // Look for Comparison constraints that use a range operator
                if (constraint instanceof Comparison) {
                    Comparison comparison = (Comparison)constraint;
                    if (comparison.operator().isRangeOperator()) {
                        selectNodeByOperand.put(comparison.getOperand1(), select);
                    }
                }
            }
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

        }
        if (constraint instanceof Comparison) {
            Comparison comparison = (Comparison)constraint;
            DynamicOperand operand = comparison.getOperand1();
            if (isPathOriented(operand)) {
                return new Comparison(operand, comparison.operator(), comparison.getOperand2());
            }
            return comparison;
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria criteria = (SetCriteria)constraint;
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

        if (constraint instanceof Comparison) {
            Comparison comparison = (Comparison)constraint;

            // Create the correct dynamic operation ...
            final DynamicOperand dynamicOperand = comparison.getOperand1();
            final Operator operator = comparison.operator();
            final StaticOperand staticOperand = comparison.getOperand2();
            final TypeFactory<?> actualType = determineType(dynamicOperand, context, columns);
            TypeFactory<?> expectedType = null;
            ExtractFromRow op = null;
            if (operator == Operator.LIKE) {
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

        if (constraint instanceof Comparison) {
            Comparison comparison = (Comparison)constraint;
            DynamicOperand operand = comparison.getOperand1();
            DynamicOperand newOperand = rewrite(context, operand);
            if (newOperand != operand) {
                return new Comparison(newOperand, comparison.operator(), comparison.getOperand2());
            }
        } else if (constraint instanceof And) {
            And and = (And)constraint;
            Constraint left = and.left();
            Constraint right = and.right();
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

                    String path = descendantNode.getAncestorPath();
                    calculator.addIndex(DESCENDANTS_BY_PATH_INDEX_NAME, null, null, singletonList(constraint), 1000, 10000L,
                                        -1.0f, PATH_PARAMETER, path);
                } else if (constraint instanceof Comparison) {
                    Comparison comparison = (Comparison)constraint;
                    if (comparison.operator() != Operator.EQUAL_TO) return;
                    DynamicOperand leftSide = comparison.getOperand1();
                    if (leftSide instanceof NodePath) {
                        // This is a constraint on the path of a node ...
                        StaticOperand rightSide = comparison.getOperand2();
                        String path = stringValue(rightSide, context);
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

            if (left instanceof PropertyValue) {
                PropertyValue propValue = (PropertyValue)left;
                if ("jcr:path".equals(propValue.getPropertyName())) {
                    // Rewrite this constraint as a PATH criteria ...
                    NodePath path = new NodePath(propValue.selectorName());
                    return new Comparison(path, comparison.operator(), comparison.getOperand2());
                }
                if ("jcr:score".equals(propValue.getPropertyName())) {
                    // Rewrite this constraint as a SCORE criteria ...
                    FullTextSearchScore score = new FullTextSearchScore(propValue.selectorName());
                    return new Comparison(score, comparison.operator(), comparison.getOperand2());
View Full Code Here

Examples of org.modeshape.jcr.query.model.Comparison.operator()

                    return new Comparison(path, comparison.operator(), comparison.getOperand2());
                }
                if ("jcr:score".equals(propValue.getPropertyName())) {
                    // Rewrite this constraint as a SCORE criteria ...
                    FullTextSearchScore score = new FullTextSearchScore(propValue.selectorName());
                    return new Comparison(score, comparison.operator(), comparison.getOperand2());
                }
            }
        } else if (constraint instanceof FullTextSearch) {
            FullTextSearch search = (FullTextSearch)constraint;
            if (".".equals(search.getPropertyName())) {
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.