op = ANDOperation.Q2;
else
op = ANDOperation.NONE;
try {
QueryNode result = null;
switch (op) {
case NONE:
List<QueryNode> children = new ArrayList<QueryNode>();
children.add(q1.cloneTree());
children.add(q2.cloneTree());
result = new AndQueryNode(children);
return result;
case Q1:
result = q1.cloneTree();
result.add(q2.cloneTree());
return result;
case Q2:
result = q2.cloneTree();
result.add(q1.cloneTree());
return result;
case BOTH:
result = q1.cloneTree();
result.add(q2.cloneTree().getChildren());
return result;
}
} catch (CloneNotSupportedException e) {
throw new QueryNodeError(e);
}