/** * Negates the given number. * * @param n the number to be negated * @return the negated result; not guaranteed to be the same concrete * type as n; null is returned if n's type wasn't handled */ public Number negate(Number n) { // we specify Number.class as the hierarchy root so // that extraneous visit methods are ignored result = null; dispatcher.invokeVisitor( this, n, "visit"); return result; }
/** * Negates the given number. * * @param n the number to be negated * @return the negated result; not guaranteed to be the same concrete * type as n; null is returned if n's type wasn't handled */ public Number negate(Number n) { // we specify Number.class as the hierarchy root so // that extraneous visit methods are ignored result = null; dispatcher.invokeVisitor( this, n, "visit"); return result; }
@Override public void visit(RelNode p, int ordinal, RelNode parent) { // rewrite children first super.visit(p, ordinal, parent); currentRel = p; final String visitMethodName = "rewriteRel"; boolean found = dispatcher.invokeVisitor( RelStructuredTypeFlattener.this, currentRel, visitMethodName); currentRel = null; if (!found) { if (p.getInputs().size() == 0) { // for leaves, it's usually safe to assume that // no transformation is required rewriteGeneric(p); } else { throw new AssertionError("no '" + visitMethodName + "' method found for class " + p.getClass().getName()); } } } }
@Override public void visit(RelNode p, int ordinal, RelNode parent) { // rewrite children first super.visit(p, ordinal, parent); currentRel = p; final String visitMethodName = "rewriteRel"; boolean found = dispatcher.invokeVisitor( RelStructuredTypeFlattener.this, currentRel, visitMethodName); currentRel = null; if (!found) { if (p.getInputs().size() == 0) { // for leaves, it's usually safe to assume that // no transformation is required rewriteGeneric(p); } else { throw new AssertionError("no '" + visitMethodName + "' method found for class " + p.getClass().getName()); } } } }
@Override public void visit(RelNode p, int ordinal, RelNode parent) { for (;;) { rel = null; boolean found = dispatcher.invokeVisitor(this, p, REWRITE_METHOD_NAME); if (!found) { throw new AssertionError( boolean found = dispatcher.invokeVisitor(this, p, VISIT_METHOD_NAME); if (!found) { if (p instanceof InterpretableRel) {
@Override public void visit(RelNode p, int ordinal, RelNode parent) { for (;;) { rel = null; boolean found = dispatcher.invokeVisitor(this, p, REWRITE_METHOD_NAME); if (!found) { throw new AssertionError( boolean found = dispatcher.invokeVisitor(this, p, VISIT_METHOD_NAME); if (!found) { if (p instanceof InterpretableRel) {