/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getConstraint().hashCode(); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see {@link QueryObjectModelVisitor#visit(Not)}Not) */ public void visit(Not not) throws VisitException { strategy.visit(not); enqueue(not.getConstraint()); visitNext(); }
/** * @see org.xcmis.search.QueryObjectModelVisitor#visit(org.xcmis.search.model.constraint.Not) */ public void visit(Not node) throws VisitException { // Push query from Constraint to stack Visitors.visit(node.getConstraint(), this); final BooleanQuery resultQuery = new BooleanQuery(); // get query builded by Constraint. resultQuery.add((Query)queryBuilderStack.pop(), Occur.MUST_NOT); // combine with previous if (queryBuilderStack.size() > 0) { resultQuery.add((Query)queryBuilderStack.pop(), Occur.MUST); } else { // TODO optimize by adding initial query resultQuery.add(new MatchAllDocsQuery(), Occur.MUST); } queryBuilderStack.push(resultQuery); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(Not) */ public void visit(Not not) throws VisitException { append('('); append("NOT "); not.getConstraint().accept(this); append(')'); }