1 22 23 package org.xquark.extractor.algebra; 24 25 import java.util.List ; 26 27 import org.xquark.extractor.common.SqlWrapperException; 28 import org.xquark.extractor.xfunctions.AfCast; 29 import org.xquark.extractor.xfunctions.XFunction; 30 import org.xquark.extractor.xfunctions.XfCast; 31 32 38 public class DefaultCompleteVisitor extends DefaultAlgebraVisitor{ 39 private static final String RCSRevision = "$Revision: 1.3 $"; 40 private static final String RCSName = "$Name: $"; 41 42 43 public DefaultCompleteVisitor() { 44 } 45 46 public void visit(BinaryAtomicOp arg){ 47 arg.getLeftOperand().accept(this); 48 arg.getRightOperand().accept(this); 49 } 50 public void visit(BinaryAlgebra arg) throws SqlWrapperException { 51 arg.getLeftOperand().accept(this); 52 arg.getRightOperand().accept(this); 53 } 54 55 public void visit(BinOpOuterJoin arg) throws SqlWrapperException { 56 arg.getLeftOperand().accept(this); 57 arg.getRightOperand().accept(this); 58 59 List list = arg.getPredicateList(); 60 Expression expr = null; 61 if (null != list) { 62 for (int i = 0; i < list.size(); i++) { 63 expr = (Expression)list.get(i); 64 expr.accept(this); 65 } 66 } 67 } 68 69 public void visit(FunAggregate arg) throws SqlWrapperException { 70 arg.getOperand().accept(this); 71 } 72 73 public void visit(IfThenElse arg) throws SqlWrapperException { 74 arg.getIf().accept(this); 75 arg.getThen().accept(this); 76 arg.getElse().accept(this); 77 } 78 79 public void visit(Join arg) throws SqlWrapperException { 80 List list = arg.getOperandList(); 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 list = arg.getPredicateList(); 90 if (null != list) { 91 for (int i = 0; i < list.size(); i++) { 92 expr = (Expression)list.get(i); 93 expr.accept(this); 94 } 95 } 96 } 97 98 public void visit(SortSpecification arg) throws SqlWrapperException { 99 arg.getSortExpression().accept(this); 100 } 101 102 public void visit(TupleExpression arg) throws SqlWrapperException { 103 List list = arg.getItemList(); 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 public void visit(UnaryAlgebra arg) { 114 arg.getOperand().accept(this); 115 116 List list = arg.getParameterList(); 117 Expression expr = null; 118 if (null != list) { 119 for (int i = 0; i < list.size(); i++) { 120 expr = (Expression)list.get(i); 121 expr.accept(this); 122 } 123 } 124 } 125 126 public void visit(UnaryAtomicOp arg) { 127 arg.getOperand().accept(this); 128 } 129 130 public void visit(AfCast arg) throws SqlWrapperException { 131 arg.getExpression().accept(this); 132 } 133 134 public void visit(XfCast arg) throws SqlWrapperException { 135 arg.getExpression().accept(this); 136 } 137 138 public void visit(XFunction arg)throws SqlWrapperException { 139 List list = arg.getArguments(); 140 Expression expr = null; 141 if (null != list) { 142 for (int i = 0; i < list.size(); i++) { 143 expr = (Expression)list.get(i); 144 expr.accept(this); 145 } 146 } 147 } 148 } 149 | Popular Tags |