public E next() throws X { if (!hasPeeked) { return iteration.next(); } else { E result = peekedElement; hasPeeked = false; peekedElement = null; return result; } }
public E peek() throws X { if (!hasPeeked) { peekedElement = iteration.next(); hasPeeked = true; } return peekedElement; }
@Override public E next() { try { return (E) it.next(); } catch (Exception ex) { throw new RuntimeException(ex); } }
@Override public RyaStatement next() { try { return iterator.next().getKey(); } catch (RyaDAOException e) { Throwables.propagate(e); } return null; }
public T next() { if (!hasNext()) { throw new NoSuchElementException(); } try { return src.next(); } catch(Exception e) { throw new RuntimeException(e); } }
public Statement next() throws QueryEvaluationException { try { return baseIteration.next(); } catch (SailException e) { throw new QueryEvaluationException(e); } }
public T next() { if (!hasNext()) { throw new NoSuchElementException(); } try { return src.next(); } catch(Exception e) { throw new RuntimeException(e); } }
public boolean hasNext() throws SailException { if (addedIter != null && addedIter.hasNext()) return true; while (next == null && contextIDs.hasNext()) { next = contextIDs.next(); if (removedSet != null && removedSet.contains(next)) { next = null; } } return next != null; }
private S delegateNext() throws Exception { S result = next; if (result == null && delegate.hasNext()) { return delegate.next(); } next = null; return result; } }
public T next() { if (!hasNext()) { throw new NoSuchElementException(); } try { return src.next(); } catch(Exception e) { throw new RuntimeException(e); } }
public T next() throws QueryEvaluationException { if(!hasNext()) throw new NoSuchElementException(); try { return (T) src.next(); } catch(SailException ex) { throw new QueryEvaluationException(ex); } }
@Override public BindingSet next() throws QueryEvaluationException { QueryContext qctx = QueryContext.begin(queryPreparer); try { return iter.next(); } finally { qctx.end(); } }
public ObjectCursor(ObjectConnection manager, CloseableIteration<BindingSet, QueryEvaluationException> result, String binding) throws QueryEvaluationException { this.binding = binding; this.result = result; this.next = result.hasNext() ? result.next() : null; this.manager = manager; this.of = manager.getObjectFactory(); }
@Override protected E getNextElement() throws X { if (_index >= _iterators.length) { return null; } else if (!_iterators[_index].hasNext()) { _index++; return getNextElement(); } else { return _iterators[_index].next(); } }
@Override public RyaStatement next() throws RyaDAOException { if (query == null || !query.hasNext()) { if (!batchNext()) return null; } if (query != null && query.hasNext()) { return query.next().getKey(); } else { return null; } }
private List<BindingSet> readProperties() throws QueryEvaluationException { Value resource = next.getValue(binding); List<BindingSet> properties = new ArrayList<BindingSet>(); while (next != null && equals(resource, next.getValue(binding))) { properties.add(next); next = result.hasNext() ? result.next() : null; } return properties; }
@Override public BindingSet next() throws QueryEvaluationException { QueryBindingSet projected = new QueryBindingSet(); BindingSet result = iter.next(); for (String var : projectionVars) { Value v = result.getValue(var); projected.addBinding(var, v); } return projected; }
private boolean batchNext() throws RyaDAOException { if (!iteration.hasNext()) { return false; } Collection<Map.Entry<RyaStatement, BindingSet>> batchedResults = new ArrayList<Map.Entry<RyaStatement, BindingSet>>(); for (int i = 0; i < batch && iteration.hasNext(); i++) { batchedResults.add(new RdfCloudTripleStoreUtils.CustomEntry<RyaStatement, BindingSet>( new RyaStatement(iteration.next(), predObj.getKey(), predObj.getValue()), null)); } query = ryaQueryEngine.queryWithBindingSet(batchedResults, null); return query.hasNext(); }
private Statement getSingleStatement(final CloseableIteration<? extends Statement, SailException> iter) throws SailException { Statement st = (iter.hasNext()) ? iter.next() : null; iter.close(); return st; } }
@Override public String getVersion() throws RyaDAOException { String version = null; final CloseableIteration<RyaStatement, RyaDAOException> versIter = queryEngine.query(new RyaStatement(RTS_SUBJECT_RYA, RTS_VERSION_PREDICATE_RYA, null), conf); if (versIter.hasNext()) { version = versIter.next().getObject().getData(); } versIter.close(); return version; }