@Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof ArithmeticOperand) { ArithmeticOperand that = (ArithmeticOperand)obj; return this.operator() == that.operator() && this.getLeft().equals(that.getLeft()) && this.getRight().equals(that.getRight()); } return false; }
@Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof ArithmeticOperand) { ArithmeticOperand that = (ArithmeticOperand)obj; return this.operator() == that.operator() && this.getLeft().equals(that.getLeft()) && this.getRight().equals(that.getRight()); } return false; }
@Override public void visit( ArithmeticOperand obj ) { verifyArithmeticOperand(obj.getLeft()); verifyArithmeticOperand(obj.getRight()); }
@Override public void visit( ArithmeticOperand obj ) { verifyArithmeticOperand(obj.getLeft()); verifyArithmeticOperand(obj.getRight()); }
@Override public void visit( ArithmeticOperand arithmeticOperation ) { strategy.visit(arithmeticOperation); enqueue(arithmeticOperation.getLeft()); enqueue(arithmeticOperation.getRight()); visitNext(); }
@Override public void visit( ArithmeticOperand arithmeticOperation ) { strategy.visit(arithmeticOperation); enqueue(arithmeticOperation.getLeft()); enqueue(arithmeticOperation.getRight()); visitNext(); }
@Override public void visit( ArithmeticOperand arithmeticOperand ) { append('('); arithmeticOperand.getLeft().accept(this); append(' '); append(arithmeticOperand.operator().symbol()); append(' '); arithmeticOperand.getRight().accept(this); append(')'); }
@Override public void visit( ArithmeticOperand arithmeticOperand ) { append('('); arithmeticOperand.getLeft().accept(this); append(' '); append(arithmeticOperand.operator().symbol()); append(' '); arithmeticOperand.getRight().accept(this); append(')'); }
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); } }
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); } }
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);
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);
verifyOrdering(arith.getRight()); } else if (operand instanceof Cast) { verifyOrdering(((Cast)operand).getOperand());
verifyOrdering(arith.getRight()); } else if (operand instanceof Cast) { verifyOrdering(((Cast)operand).getOperand());
verifyComparison(arith.getRight(), op, rhs); } else if (operand instanceof Cast) { verifyComparison(((Cast)operand).getOperand(), op, rhs);
verifyComparison(arith.getRight(), op, rhs); } else if (operand instanceof Cast) { verifyComparison(((Cast)operand).getOperand(), op, rhs);
ArithmeticOperand arith = (ArithmeticOperand)operand; TypeFactory<?> leftType = determineType(arith.getLeft(), context, columns); TypeFactory<?> rightType = determineType(arith.getRight(), context, columns); return types.getCompatibleType(leftType, rightType);
ArithmeticOperand arith = (ArithmeticOperand)operand; TypeFactory<?> leftType = determineType(arith.getLeft(), context, columns); TypeFactory<?> rightType = determineType(arith.getRight(), context, columns); return types.getCompatibleType(leftType, rightType);
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);
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);