public ConstraintImpl in(DynamicOperandImpl left, ArrayList<StaticOperandImpl> list) { return new InImpl(left, list); }
/** * Calls accept on the all operands in the "in" node. */ @Override public boolean visit(InImpl node) { node.getOperand1().accept(this); for (StaticOperandImpl s : node.getOperand2()) { s.accept(this); } return true; }
@Override public boolean visit(InImpl node) { node.setQuery(query); return super.visit(node); }
} else if (constraint instanceof InImpl) { InImpl in = (InImpl) constraint; DynamicOperandImpl o = in.getOperand1(); if (operand == null || operand.equals(o)) { operand = o; values.addAll(in.getOperand2()); } else { multiPropertyOr = true; if (constraint instanceof InImpl) { InImpl in = (InImpl) constraint; if (operand.equals(in.getOperand1())) { values.addAll(in.getOperand2()); found = true; break; InImpl in = new InImpl(operand, newArrayList(values)); in.setQuery(query); in.restrictPushDown(s);
changed = true; } else if (simple instanceof InImpl) { DynamicOperandImpl o = ((InImpl) simple).getOperand1(); LinkedHashSet<StaticOperandImpl> values = in.get(o); if (values == null) { in.put(o, values); values.addAll(((InImpl) simple).getOperand2()); iterator.remove(); changed = true; entry.getKey(), EQUAL, values.iterator().next())); } else { simplified.add(new InImpl( entry.getKey(), newArrayList(values)));
@Override public boolean evaluate() { // JCR 2.0 spec, 6.7.16 Comparison: // "operand1 may evaluate to an array of values" PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false; } for (StaticOperandImpl s : operand2) { PropertyValue p2 = s.currentValue(); if (p2 == null) { // if the property doesn't exist, the result is false continue; } // "the value of operand2 is converted to the // property type of the value of operand1" p2 = convertValueToType(p2, p1); if (PropertyValues.match(p1, p2)) { return true; } } return false; }
} else if (constraint instanceof InImpl) { InImpl in = (InImpl) constraint; DynamicOperandImpl o = in.getOperand1(); if (operand == null || operand.equals(o)) { operand = o; values.addAll(in.getOperand2()); } else { multiPropertyOr = true; if (constraint instanceof InImpl) { InImpl in = (InImpl) constraint; if (operand.equals(in.getOperand1())) { values.addAll(in.getOperand2()); found = true; break; InImpl in = new InImpl(operand, newArrayList(values)); in.setQuery(query); in.restrictPushDown(s);
changed = true; } else if (simple instanceof InImpl) { DynamicOperandImpl o = ((InImpl) simple).getOperand1(); LinkedHashSet<StaticOperandImpl> values = in.get(o); if (values == null) { in.put(o, values); values.addAll(((InImpl) simple).getOperand2()); iterator.remove(); changed = true; entry.getKey(), EQUAL, values.iterator().next())); } else { simplified.add(new InImpl( entry.getKey(), newArrayList(values)));
@Override public boolean evaluate() { // JCR 2.0 spec, 6.7.16 Comparison: // "operand1 may evaluate to an array of values" PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false; } for (StaticOperandImpl s : operand2) { PropertyValue p2 = s.currentValue(); if (p2 == null) { // if the property doesn't exist, the result is false continue; } // "the value of operand2 is converted to the // property type of the value of operand1" p2 = convertValueToType(p2, p1); if (PropertyValues.match(p1, p2)) { return true; } } return false; }
} else if (constraint instanceof InImpl) { InImpl in = (InImpl) constraint; DynamicOperandImpl o = in.getOperand1(); if (operand == null || operand.equals(o)) { operand = o; values.addAll(in.getOperand2()); } else { multiPropertyOr = true; if (constraint instanceof InImpl) { InImpl in = (InImpl) constraint; if (operand.equals(in.getOperand1())) { values.addAll(in.getOperand2()); found = true; break; InImpl in = new InImpl(operand, newArrayList(values)); in.setQuery(query); in.restrictPushDown(s);
changed = true; } else if (simple instanceof InImpl) { DynamicOperandImpl o = ((InImpl) simple).getOperand1(); LinkedHashSet<StaticOperandImpl> values = in.get(o); if (values == null) { in.put(o, values); values.addAll(((InImpl) simple).getOperand2()); iterator.remove(); changed = true; entry.getKey(), EQUAL, values.iterator().next())); } else { simplified.add(new InImpl( entry.getKey(), newArrayList(values)));
public ConstraintImpl in(DynamicOperandImpl left, ArrayList<StaticOperandImpl> list) { return new InImpl(left, list); }
/** * Calls accept on the all operands in the "in" node. */ @Override public boolean visit(InImpl node) { node.getOperand1().accept(this); for (StaticOperandImpl s : node.getOperand2()) { s.accept(this); } return true; }
@Override public boolean visit(InImpl node) { node.setQuery(query); return super.visit(node); }
@Override public boolean evaluate() { // JCR 2.0 spec, 6.7.16 Comparison: // "operand1 may evaluate to an array of values" PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false; } for (StaticOperandImpl s : operand2) { PropertyValue p2 = s.currentValue(); if (p2 == null) { // if the property doesn't exist, the result is false continue; } // "the value of operand2 is converted to the // property type of the value of operand1" p2 = convertValueToType(p2, p1); if (PropertyValues.match(p1, p2)) { return true; } } return false; }
public ConstraintImpl in(DynamicOperandImpl left, ArrayList<StaticOperandImpl> list) { return new InImpl(left, list); }
/** * Calls accept on the all operands in the "in" node. */ @Override public boolean visit(InImpl node) { node.getOperand1().accept(this); for (StaticOperandImpl s : node.getOperand2()) { s.accept(this); } return true; }
@Override public boolean visit(InImpl node) { node.setQuery(query); return super.visit(node); }
@Override public AstElement copyOf() { return new InImpl(operand1.createCopy(), operand2); } }