public PathIteration( StrictEvaluationStrategy evaluationStrategyImpl, Scope scope, Var startVar, TupleExpr pathExpression, Var endVar, Var contextVar, long minLength, BindingSet bindings) throws QueryEvaluationException { this.evaluationStrategyImpl = evaluationStrategyImpl; this.scope = scope; this.startVar = startVar; this.endVar = endVar; this.startVarFixed = startVar.hasValue() || bindings.hasBinding(startVar.getName()); this.endVarFixed = endVar.hasValue() || bindings.hasBinding(endVar.getName()); this.pathExpression = pathExpression; this.contextVar = contextVar; this.currentLength = minLength; this.bindings = bindings; this.reportedValues = makeSet(); this.unreportedValues = makeSet(); this.valueQueue = makeQueue(); createIteration(); }
@Override public void meet(Var var) { if (toBeReplaced.equals(var) || (toBeReplaced.isAnonymous() && var.isAnonymous() && (toBeReplaced.hasValue() && toBeReplaced.getValue().equals(var.getValue())))) { QueryModelNode parent = var.getParentNode(); parent.replaceChildNode(var, replacement); replacement.setParentNode(parent); } else if (replaceAnons && var.isAnonymous() && !var.hasValue()) { Var replacementVar = createAnonVar("anon-replace-" + var.getName() + index); QueryModelNode parent = var.getParentNode(); parent.replaceChildNode(var, replacementVar); replacementVar.setParentNode(parent); } }