1 22 23 package org.xquark.extractor.algebra; 24 25 26 import java.util.List ; 27 28 import org.xquark.extractor.common.SqlWrapperException; 29 import org.xquark.extractor.xfunctions.AfCast; 30 import org.xquark.extractor.xfunctions.XFunction; 31 import org.xquark.extractor.xfunctions.XfCast; 32 33 40 public class DefaultSimpleVisitor extends DefaultAlgebraVisitor { 41 42 private static final String RCSRevision = "$Revision: 1.3 $"; 43 private static final String RCSName = "$Name: $"; 44 45 46 public DefaultSimpleVisitor() { 47 } 48 49 public void visit(BinaryOperator arg){ 50 arg.getLeftOperand().accept(this); 51 arg.getRightOperand().accept(this); 52 } 53 54 public void visit(FunAggregate arg) throws SqlWrapperException { 55 arg.getOperand().accept(this); 56 } 57 58 public void visit(IfThenElse arg) throws SqlWrapperException { 59 arg.getIf().accept(this); 60 arg.getThen().accept(this); 61 arg.getElse().accept(this); 62 } 63 64 public void visit(Join arg) throws SqlWrapperException { 65 List list = arg.getOperandList(); 66 Expression expr = null; 67 if (null != list) { 68 for (int i = 0; i < list.size(); i++) { 69 expr = (Expression)list.get(i); 70 expr.accept(this); 71 } 72 } 73 } 74 75 public void visit(SortSpecification arg) throws SqlWrapperException { 76 arg.getSortExpression().accept(this); 77 } 78 79 public void visit(TupleExpression arg) throws SqlWrapperException { 80 List list = arg.getItemList(); 81 Expression expr = null; 82 if (null != list) { 83 for (int i = 0; i < list.size(); i++) { 84 expr = (Expression)list.get(i); 85 expr.accept(this); 86 } 87 } 88 } 89 90 public void visit(UnaryOperator arg) { 91 arg.getOperand().accept(this); 92 } 93 94 public void visit(AfCast arg) throws SqlWrapperException { 95 arg.getExpression().accept(this); 96 } 97 98 public void visit(XfCast arg) throws SqlWrapperException { 99 arg.getExpression().accept(this); 100 } 101 102 public void visit(XFunction arg)throws SqlWrapperException { 103 List list = arg.getArguments(); 104 Expression expr = null; 105 if (null != list) { 106 for (int i = 0; i < list.size(); i++) { 107 expr = (Expression)list.get(i); 108 expr.accept(this); 109 } 110 } 111 } 112 } 113 | Popular Tags |