@Test public void testEliminateNotNot() throws Exception { QueryExpression v1 = _not(new RegexMatchExpression(new Path("f1"), "X", false, false, false, false)); QueryExpression q = _not(v1); QueryExpression newq = rw.rewrite(q); System.out.println(q + " ->\n" + newq); Assert.assertTrue(newq instanceof RegexMatchExpression); }
@Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } QueryRewriter();  QueryRewriter(boolean withDefaultRules); }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } QueryRewriter();  QueryRewriter(boolean withDefaultRules); void register(Rewriter rule); @Override QueryExpression rewrite(QueryExpression q); }
QueryRewriter extends Rewriter { @Override public QueryExpression rewrite(QueryExpression q) { QueryExpression trc = q; QueryExpression newq; boolean done = false; do { newq = rewriteIteration(trc); LOGGER.debug("Rewrite iteration pre={}", trc); LOGGER.debug("Rewrite iteration post={}", newq); if (newq == trc) { done = true; } trc = newq; } while (!done); return newq; } QueryRewriter();  QueryRewriter(boolean withDefaultRules); void register(Rewriter rule); @Override QueryExpression rewrite(QueryExpression q);  }