1 22 23 package org.xquark.mediator.algebra; 24 25 import java.util.ArrayList ; 26 27 import org.xquark.mediator.decomposer.IsolateWhereVisitor; 28 import org.xquark.mediator.plan.ExecutionPlan; 29 import org.xquark.mediator.plan.OpValue; 30 import org.xquark.mediator.plan.Operator; 31 import org.xquark.mediator.runtime.MediatorException; 32 import org.xquark.xquery.parser.Variable; 33 import org.xquark.xquery.parser.XQueryException; 34 import org.xquark.xquery.parser.XQueryExpression; 35 36 41 public class AlgValue extends Algebra { 42 private static final String RCSRevision = "$Revision: 1.4 $"; 46 private static final String RCSName = "$Name: $"; 47 48 private XQueryExpression condition = null; 49 59 public AlgValue(XQueryExpression expression, Variable var, AlgebraManager depmanager, boolean islet) { 60 super(expression, var, depmanager, islet) ; 61 if (var != null && var.getParentFLWRExpression().getWhereClause() != null) { 63 ArrayList tmplist = new ArrayList (1); 64 tmplist.add(var); 65 IsolateWhereVisitor isolateVisitor = new IsolateWhereVisitor(tmplist); 66 try { 67 var.getParentFLWRExpression().getWhereClause().accept(isolateVisitor); 68 condition = isolateVisitor.getIsolatedExpression(); 69 if (condition != null) 70 var.getParentFLWRExpression().setWhereClause(isolateVisitor.getRemainingExpression()); 71 } catch (XQueryException e) { 72 } 73 } 74 if (depmanager.getIdVars().contains(var)) this.hasIdentifier = true; 76 } 77 78 82 public void ParentHasIdentifier() { 83 hasIdentifier = true; 84 } 85 86 94 public Operator createOperator(ExecutionPlan plan) throws MediatorException { 95 Operator operator = new OpValue(plan, this, condition, hasIdentifier) ; 97 operator.isLet(islet); 98 return operator ; 99 } 100 101 105 public ArrayList getVarsThatDepend() throws MediatorException { 106 return new ArrayList () ; 107 } 108 109 public Object clone() throws CloneNotSupportedException { 110 AlgValue newobj = (AlgValue)super.clone(); 111 return newobj; 112 } 113 114 public void execute(ExecutionPlan plan) throws MediatorException { 115 } 116 117 121 } 122 | Popular Tags |