Package org.jrdf.query.expression

Examples of org.jrdf.query.expression.Expression


        }
        return null;
    }

    public Void visitOptional(Optional optional) {
        Expression lhsExp = optional.getLhs();
        lhsExp = (lhsExp == null) ? EMPTY_CONSTRAINT : lhsExp;
        Expression lhs = getNext(lhsExp);
        Expression rhsExp = optional.getRhs();
        rhsExp = (rhsExp == null) ? EMPTY_CONSTRAINT : rhsExp;
        Expression rhs = getNext(rhsExp);
        expression = new Optional(lhs, rhs);
        return null;
    }
View Full Code Here


        }
        return null;
    }

    public Void visitLogicAnd(LogicAndExpression andExpression) {
        Expression lhs = getNext(andExpression.getLhs());
        Expression rhs = getNext(andExpression.getRhs());
        if (lhs == null && rhs == null) {
            expression = null;
        } else if (lhs == null) {
            expression = rhs;
        } else if (rhs == null) {
View Full Code Here

        }
        return null;
    }

    public Void visitLogicOr(LogicOrExpression orExpression) {
        Expression lhs = getNext(orExpression.getLhs());
        Expression rhs = getNext(orExpression.getRhs());
        if (lhs == null && rhs == null) {
            expression = null;
        } else if (lhs == null) {
            expression = rhs;
        } else if (rhs == null) {
View Full Code Here

        }
        return null;
    }

    public Void visitEqualsExpression(EqualsExpression equalsExpression) {
        Expression lhs = getNext(equalsExpression.getLhs());
        Expression rhs = getNext(equalsExpression.getRhs());
        final List<Expression> pair = reorderPairs(lhs, rhs);
        boolean changed = equateExpressions(lhs, rhs);
        if (!changed) {
            changed = equateAVOs(pair.get(0).getValue(), pair.get(1).getValue());
            if (changed) {
View Full Code Here

        }
        return avo;
    }

    public Void visitLessThanExpression(LessThanExpression lessThanExpression) {
        Expression lhs = getNext(lessThanExpression.getLhs());
        Expression rhs = getNext(lessThanExpression.getRhs());
        expression = new LessThanExpression(lhs, rhs);
        return null;
    }
View Full Code Here

        expression = new LessThanExpression(lhs, rhs);
        return null;
    }

    public Void visitNEqualsExpression(NEqualsExpression nEqualsExpression) {
        Expression lhs = getNext(nEqualsExpression.getLhs());
        Expression rhs = getNext(nEqualsExpression.getRhs());
        expression = new NEqualsExpression(lhs, rhs);
        return null;
    }
View Full Code Here

        expression = new NEqualsExpression(lhs, rhs);
        return null;
    }

    public Void visitAsk(Ask ask) {
        Expression next = getNext(ask.getNextExpression());
        ask.setNextExpression(next);
        expression = ask;
        return null;
    }
View Full Code Here

    }

    @Override
    public void caseAEMoreNumericExpression(AEMoreNumericExpression node) {
        try {
            Expression lhsExp = expression;
            node.getNumericExpression().apply(numericExpressionAnalyser);
            Expression rhsExp = numericExpressionAnalyser.getExpression();
            final List<Expression> expressions = tryUpdateAttribute(lhsExp, rhsExp);
            expression = new EqualsExpression(expressions.get(0), expressions.get(1));
        } catch (ParserException e) {
            exception = e;
        }
View Full Code Here

    }

    @Override
    public void caseANeMoreNumericExpression(ANeMoreNumericExpression node) {
        try {
            Expression lhsExp = expression;
            node.getNumericExpression().apply(numericExpressionAnalyser);
            Expression rhsExp = numericExpressionAnalyser.getExpression();
            final List<Expression> expressions = tryUpdateAttribute(lhsExp, rhsExp);
            expression = new NEqualsExpression(expressions.get(0), expressions.get(1));
        } catch (ParserException e) {
            exception = e;
        }
View Full Code Here

    }

    @Override
    public void caseALtMoreNumericExpression(ALtMoreNumericExpression node) {
        try {
            Expression lhsExp = expression;
            node.getNumericExpression().apply(numericExpressionAnalyser);
            Expression rhsExp = numericExpressionAnalyser.getExpression();
            final List<Expression> expressions = tryUpdateAttribute(lhsExp, rhsExp);
            expression = new LessThanExpression(expressions.get(0), expressions.get(1));
        } catch (ParserException e) {
            exception = e;
        }
View Full Code Here

TOP

Related Classes of org.jrdf.query.expression.Expression

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.