public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Intersection intersection, final BindingSet bindings) throws QueryEvaluationException { Iteration<BindingSet, QueryEvaluationException> leftArg, rightArg; leftArg = new DelayedIteration<BindingSet, QueryEvaluationException>() { @Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getLeftArg(), bindings); } }; rightArg = new DelayedIteration<BindingSet, QueryEvaluationException>() { @Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getRightArg(), bindings); } }; return new IntersectIteration<BindingSet, QueryEvaluationException>(leftArg, rightArg); }
/** * Returns <tt>true</tt> if the object is in the set of elements of the second argument. */ protected boolean accept(E object) throws X { if (!initialized) { synchronized(this) { if (!initialized) { // Build set of elements-to-include from second argument includeSet = addSecondSet(arg2, makeSet()); initialized = true; } } } if (inIncludeSet(object)) { // Element is part of the result if (distinct) { // Prevent duplicates from being returned by // removing the element from the include set removeFromIncludeSet(object); } return true; } return false; }
public Set<E> addSecondSet(Iteration<? extends E, ? extends X> arg2, Set<E> set) throws X { return Iterations.addAll(arg2, makeSet()); }
/** * After closing the set is cleared and any "used" capacity for collections is returned. */ @Override protected void handleClose() throws QueryEvaluationException { try { super.handleClose(); } finally { long size = clearIncludeSet(); used.addAndGet(-size); } }
public Set<E> addSecondSet(Iteration<? extends E, ? extends X> arg2, Set<E> set) throws X { return Iterations.addAll(arg2, makeSet()); }
/** * After closing the set is cleared and any "used" capacity for collections is returned. */ @Override protected void handleClose() throws QueryEvaluationException { try { super.handleClose(); } finally { long size = clearIncludeSet(); used.addAndGet(-size); } }
/** * Returns <tt>true</tt> if the object is in the set of elements of the second argument. */ protected boolean accept(E object) throws X { if (!initialized) { synchronized(this) { if (!initialized) { // Build set of elements-to-include from second argument includeSet = addSecondSet(arg2, makeSet()); initialized = true; } } } if (inIncludeSet(object)) { // Element is part of the result if (distinct) { // Prevent duplicates from being returned by // removing the element from the include set removeFromIncludeSet(object); } return true; } return false; }
public Set<E> addSecondSet(Iteration<? extends E, ? extends X> arg2, Set<E> set) throws X { return Iterations.addAll(arg2, makeSet()); }
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final Intersection intersection, final BindingSet bindings) throws QueryEvaluationException { Iteration<BindingSet, QueryEvaluationException> leftArg, rightArg; leftArg = new DelayedIteration<BindingSet, QueryEvaluationException>() { @Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getLeftArg(), bindings); } }; rightArg = new DelayedIteration<BindingSet, QueryEvaluationException>() { @Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getRightArg(), bindings); } }; return new IntersectIteration<BindingSet, QueryEvaluationException>(leftArg, rightArg); }
/** * Returns <tt>true</tt> if the object is in the set of elements of the second argument. */ @Override protected boolean accept(E object) throws X { if (!initialized) { synchronized(this) { if (!initialized) { // Build set of elements-to-include from second argument includeSet = addSecondSet(arg2, makeSet()); initialized = true; } } } if (inIncludeSet(object)) { // Element is part of the result if (distinct) { // Prevent duplicates from being returned by // removing the element from the include set removeFromIncludeSet(object); } return true; } return false; }