private int countElements(Iteration<?, ?> iter) throws Exception { int count = 0; try { while (iter.hasNext()) { iter.next(); count++; } } finally { Iterations.closeCloseable(iter); } return count; }
@Override protected void handleClose() throws QueryEvaluationException { super.handleClose(); leftIter.close(); rightIter.close(); hashTable = null; hashTableValues = null; scanList = null; }
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(EmptySet emptySet, BindingSet bindings) throws QueryEvaluationException { return new EmptyIteration<BindingSet, QueryEvaluationException>(); }
public E next() throws X { if (!hasPeeked) { return iteration.next(); } else { E result = peekedElement; hasPeeked = false; peekedElement = null; return result; } }
public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements( Resource subj, URI pred, Value obj, Resource... contexts) throws QueryEvaluationException { return new EmptyIteration<Statement, QueryEvaluationException>(); } });
@Override public void remove() throws QueryEvaluationException { iter.remove(); }
@Override protected void handleClose() throws QueryEvaluationException { Iterations.closeCloseable(currentIter); super.handleClose(); }
@Override public void remove() throws QueryEvaluationException { filter.remove(); }
@Override public BindingSet next() throws QueryEvaluationException { return filter.next(); }
@Override public void close() throws QueryEvaluationException { if(open) { src.close(); open = false; } }
@Override protected void handleClose() throws QueryEvaluationException { super.handleClose(); leftIter.close(); rightIter.close(); } }
public E peek() throws X { if (!hasPeeked) { peekedElement = iteration.next(); hasPeeked = true; } return peekedElement; }
private <T> T first(Iteration<T, ?> iter) throws Exception { try { if (iter.hasNext()) { return iter.next(); } } finally { Iterations.closeCloseable(iter); } return null; }
@Override public void close() throws QueryEvaluationException { iter.close(); } };
@Override protected void handleClose() throws QueryEvaluationException { super.handleClose(); leftIter.close(); rightIter.close(); } }
private int countElements(Iteration<?, ?> iter) throws Exception { int count = 0; try { while (iter.hasNext()) { iter.next(); count++; } } finally { Iterations.closeCloseable(iter); } return count; }
private <T> T first(Iteration<T, ?> iter) throws Exception { try { if (iter.hasNext()) { return iter.next(); } } finally { Iterations.closeCloseable(iter); } return null; }
private void close() throws E { if (null != iteration) { try { iteration.close(); } finally { iteration = null; } } } }