@Override public T next() throws E { final T result = super.next(); ++this.count; return result; }
@Override protected void handleClose() throws E { try { super.handleClose(); } finally { LOGGER.debug("Repository iteration closed after {} ms", System.currentTimeMillis() - ts); } }
@Override public boolean hasNext() throws E { this.hasNext = super.hasNext(); return this.hasNext; }
@Override public synchronized void remove() throws X { if (isClosed()) { throw new IllegalStateException(); } super.remove(); }
@Override public synchronized T next() throws X { if (isClosed()) { throw new NoSuchElementException("Iteration has been closed"); } return super.next(); }
@Override protected void handleClose() throws E { try { super.handleClose(); } finally { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} - {} closed after {} ms, {} results retrieved{}", LoggingTripleTransaction.this, name, System.currentTimeMillis() - ts, this.count, this.hasNext ? "" : " (exhausted)"); } } }
@Override public synchronized boolean hasNext() throws X { if (isClosed()) { return false; } if (super.hasNext()) { return true; } close(); return false; }
@Override public BindingSet next() throws QueryEvaluationException { BindingSet next = super.next(); if (next == null) { return null; } int size = bindings.size() + next.size(); SPARQLQueryBindingSet set = new SPARQLQueryBindingSet(size); set.addAll(bindings); for (Binding binding : next) { set.setBinding(binding); } return set; }
@Override protected void handleClose() throws QueryEvaluationException { try { super.handleClose(); } finally { closed = true; try { in.close(); } catch (IOException e) { throw new QueryEvaluationException(e); } finally { queue.close(); } } }
@Override public BindingSet next() throws QueryEvaluationException { BindingSet next = super.next(); if (next == null) { return null; } int size = bindings.size() + next.size(); QueryBindingSet set = new QueryBindingSet(size); set.addAll(bindings); for (Binding binding : next) { set.setBinding(binding); } return set; }
@Override protected void handleClose() throws X { try { super.handleClose(); } finally { synchronized (this) { for (SailClosable closing : closes) { try { closing.close(); } catch (SailException e) { handleSailException(e); } } } } }
@Override public BindingSet next() throws QueryEvaluationException { BindingSet next = super.next(); if (next == null) { return null; } int size = bindings.size() + next.size(); QueryBindingSet set = new QueryBindingSet(size); set.addAll(bindings); for (Binding binding : next) { set.setBinding(binding); } return set; }
@Override public BindingSet next() throws QueryEvaluationException { BindingSet next = super.next(); QueryBindingSet result; if (next == null) { result = null; // NOPMD } else { int size = bindings.size() + next.size(); result = new QueryBindingSet(size); result.addAll(bindings); for (Binding binding : next) { result.setBinding(binding); } } return result; }