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; }
private void calculateNext() { if (parentIterator != null) { while (next.isEmpty() && parentIterator.hasNext()) { parentIterator.next(); } } }
private void calculateNext() { while (next == null && parentIterator.hasNext()) { parentIterator.next(); } }
private void calculateNext() { if (parentIterator != null) { while (next.isEmpty() && parentIterator.hasNext()) { parentIterator.next(); } } }
public Statement next() throws QueryEvaluationException { try { return baseIteration.next(); } catch (SailException e) { throw new QueryEvaluationException(e); } }
public Namespace next() throws SailException { try { return innerIter.next(); } catch (RepositoryException e) { throw new SailException(e); } }
@Override public Tuple next() throws SailException { assert parentIterator.hasNext() : parentIterator.getClass().getSimpleName() + " does not have any more items but next was still called!!!"; Tuple next = parentIterator.next(); assert next != null; System.out.println(leadingSpace() + parent.getClass().getSimpleName() + ".next(): " + " " + next.toString()); return next; }
@Override public Tuple next() throws SailException { assert parentIterator.hasNext() : parentIterator.getClass().getSimpleName() + " does not have any more items but next was still called!!!"; Tuple next = parentIterator.next(); assert next != null; System.out.println(leadingSpace() + parent.getClass().getSimpleName() + ".next(): " + " " + next.toString()); return next; }
@Override public Tuple next() throws SailException { Tuple next = parentIterator.next(); Tuple tuple = new Tuple(); for (int i = 0; i < newLength && i < next.line.size(); i++) { tuple.line.add(next.line.get(i)); tuple.addHistory(next); } return tuple; }
private void initialize() { if (tuplesBuffer == null) { tuplesBuffer = new ArrayList<>(); try (CloseableIteration<Tuple, SailException> iterator = parent.iterator()) { while (iterator.hasNext()) { Tuple next = iterator.next(); tuplesBuffer.add(next); } } } }
private void addStatementsInGraph(final org.eclipse.rdf4j.model.Resource graph, final Collection<Statement> statements, final SailConnection c) throws SailException { try (CloseableIteration<? extends Statement, SailException> stIter = c.getStatements(null, null, null, false, graph)) { while (stIter.hasNext()) { statements.add(stIter.next()); } } }
public Statement next() { try { last = stmts.next(); if (last == null) { stmts.close(); } return last; } catch (SailException e) { throw new ModelException(e); } }
public Statement next() { try { last = stmts.next(); if (last == null) { stmts.close(); } return last; } catch (SailException e) { throw new ModelException(e); } }
@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; } }
void calculateNext() { while (next == null && parentIterator.hasNext()) { Tuple temp = parentIterator.next(); Resource subject = (Resource) temp.line.get(0); if (shaclSailConnection.hasStatement(subject, RDF.TYPE, filterOnType, true)) { next = temp; next.addHistory(new Tuple(Arrays.asList(subject, RDF.TYPE, filterOnType))); } } }
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 void writeNamespaces(SailDataset store, DataOutputStream dataOut) throws IOException, SailException { try (CloseableIteration<? extends Namespace, SailException> iter = store.getNamespaces();) { while (iter.hasNext()) { Namespace ns = iter.next(); dataOut.writeByte(NAMESPACE_MARKER); writeString(ns.getPrefix(), dataOut); writeString(ns.getName(), dataOut); } } }
@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; }
private void cacheStatements(final Resource subj, final IRI pred, final Value obj) throws SailException { cacheConnection.begin(); CloseableIteration<? extends Statement, SailException> iter = baseSailConnection.getStatements(subj, pred, obj, false); while (iter.hasNext()) { Statement st = iter.next(); cacheConnection.addStatement(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext()); } iter.close(); cacheConnection.commit(); }