public ComparisonImpl comparison(DynamicOperandImpl operand1, Operator operator, StaticOperandImpl operand2) { return new ComparisonImpl(operand1, operator, operand2); }
/** * Calls accept on the two operands in the comparison node. */ @Override public boolean visit(ComparisonImpl node) { node.getOperand1().accept(this); node.getOperand2().accept(this); return true; }
@Override public boolean visit(ComparisonImpl node) { node.setQuery(query); return super.visit(node); }
ConstraintImpl simple = iterator.next(); if (simple instanceof ComparisonImpl && ((ComparisonImpl) simple).getOperator() == EQUAL) { DynamicOperandImpl o = ((ComparisonImpl) simple).getOperand1(); LinkedHashSet<StaticOperandImpl> values = in.get(o); if (values == null) { in.put(o, values); values.add(((ComparisonImpl) simple).getOperand2()); iterator.remove(); changed = true; LinkedHashSet<StaticOperandImpl> values = entry.getValue(); if (values.size() == 1) { simplified.add(new ComparisonImpl( entry.getKey(), EQUAL, values.iterator().next())); } else {
p2 = convertValueToType(p2, p1); int targetType = getCommonType(p1, p2); p1 = convertToType(p1, targetType); p2 = convertToType(p2, targetType);
&& ((ComparisonImpl) constraint).getOperator() == EQUAL) { ComparisonImpl comparison = (ComparisonImpl) constraint; DynamicOperandImpl o = comparison.getOperand1(); if (operand == null || operand.equals(o)) { operand = o; values.add(comparison.getOperand2()); } else { multiPropertyOr = true; && ((ComparisonImpl) constraint).getOperator() == EQUAL) { ComparisonImpl comparison = (ComparisonImpl) constraint; if (operand.equals(comparison.getOperand1())) { values.add(comparison.getOperand2()); found = true; break;
ConstraintImpl simple = iterator.next(); if (simple instanceof ComparisonImpl && ((ComparisonImpl) simple).getOperator() == EQUAL) { DynamicOperandImpl o = ((ComparisonImpl) simple).getOperand1(); LinkedHashSet<StaticOperandImpl> values = in.get(o); if (values == null) { in.put(o, values); values.add(((ComparisonImpl) simple).getOperand2()); iterator.remove(); changed = true; LinkedHashSet<StaticOperandImpl> values = entry.getValue(); if (values.size() == 1) { simplified.add(new ComparisonImpl( entry.getKey(), EQUAL, values.iterator().next())); } else {
p2 = convertValueToType(p2, p1); int targetType = getCommonType(p1, p2); p1 = convertToType(p1, targetType); p2 = convertToType(p2, targetType);
&& ((ComparisonImpl) constraint).getOperator() == EQUAL) { ComparisonImpl comparison = (ComparisonImpl) constraint; DynamicOperandImpl o = comparison.getOperand1(); if (operand == null || operand.equals(o)) { operand = o; values.add(comparison.getOperand2()); } else { multiPropertyOr = true; && ((ComparisonImpl) constraint).getOperator() == EQUAL) { ComparisonImpl comparison = (ComparisonImpl) constraint; if (operand.equals(comparison.getOperand1())) { values.add(comparison.getOperand2()); found = true; break;
ConstraintImpl simple = iterator.next(); if (simple instanceof ComparisonImpl && ((ComparisonImpl) simple).getOperator() == EQUAL) { DynamicOperandImpl o = ((ComparisonImpl) simple).getOperand1(); LinkedHashSet<StaticOperandImpl> values = in.get(o); if (values == null) { in.put(o, values); values.add(((ComparisonImpl) simple).getOperand2()); iterator.remove(); changed = true; LinkedHashSet<StaticOperandImpl> values = entry.getValue(); if (values.size() == 1) { simplified.add(new ComparisonImpl( entry.getKey(), EQUAL, values.iterator().next())); } else {
p2 = convertValueToType(p2, p1); int targetType = getCommonType(p1, p2); p1 = convertToType(p1, targetType); p2 = convertToType(p2, targetType);
&& ((ComparisonImpl) constraint).getOperator() == EQUAL) { ComparisonImpl comparison = (ComparisonImpl) constraint; DynamicOperandImpl o = comparison.getOperand1(); if (operand == null || operand.equals(o)) { operand = o; values.add(comparison.getOperand2()); } else { multiPropertyOr = true; && ((ComparisonImpl) constraint).getOperator() == EQUAL) { ComparisonImpl comparison = (ComparisonImpl) constraint; if (operand.equals(comparison.getOperand1())) { values.add(comparison.getOperand2()); found = true; break;
public ComparisonImpl comparison(DynamicOperandImpl operand1, Operator operator, StaticOperandImpl operand2) { return new ComparisonImpl(operand1, operator, operand2); }
/** * Calls accept on the two operands in the comparison node. */ @Override public boolean visit(ComparisonImpl node) { node.getOperand1().accept(this); node.getOperand2().accept(this); return true; }
@Override public boolean visit(ComparisonImpl node) { node.setQuery(query); return super.visit(node); }
public ComparisonImpl comparison(DynamicOperandImpl operand1, Operator operator, StaticOperandImpl operand2) { return new ComparisonImpl(operand1, operator, operand2); }
/** * Calls accept on the two operands in the comparison node. */ @Override public boolean visit(ComparisonImpl node) { node.getOperand1().accept(this); node.getOperand2().accept(this); return true; }
@Override public boolean visit(ComparisonImpl node) { node.setQuery(query); return super.visit(node); }
@Override public ConstraintImpl simplify() { if (operand2.size() == 1) { return new ComparisonImpl( operand1, Operator.EQUAL, operand2.iterator().next()); } Set<StaticOperandImpl> set = newHashSet(operand2); if (set.size() == 1) { return new ComparisonImpl( operand1, Operator.EQUAL, set.iterator().next()); } else if (set.size() != operand2.size()) { return new InImpl(operand1, newArrayList(set)); } else { return this; } }
@Override public AstElement copyOf() { return new ComparisonImpl(operand1.createCopy(), operator, operand2); } }