@Override public boolean hasNext() { return src.hasNext(); }
@Override public boolean hasNext() { return src.hasNext(); }
public boolean hasNext() { if (lastIndex != -1 && lastIndex + 1 < chunk.length) { return true; } log.debug("Testing source iterator."); return src.hasNext(); }
public boolean hasNext() { if (lastIndex != -1 && lastIndex + 1 < chunk.length) { return true; } log.debug("Testing source iterator."); return src.hasNext(); }
public boolean hasNext() { if(open && src.hasNext()) return true; /* * Explicit close so we close the source as well when this is exhausted. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/361 */ close(); return false; }
@Override public boolean hasNext() { if (!open) return false; if (!src.hasNext()) { close(); return false; } return true; }
@Override public boolean hasNext() { if (!open) return false; if (!src.hasNext()) { close(); return false; } return true; }
public boolean hasNext() { if(open && src.hasNext()) return true; /* * Explicit close so we close the source as well when this is exhausted. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/361 */ close(); return false; }
@Override public boolean isEmpty() { final IChunkedIterator<ISPO> itr = iterator(0L/* offset */, 1L/* limit */, 1/* capacity */); try { return ! itr.hasNext(); } finally { itr.close(); } }
public boolean hasNext() { while ((chunk == null || index == chunk.length) && src.hasNext()) { // fetch and filter another chunk. chunk = filter.filterChunk(src.nextChunk()); // reset the index into the current chunk. index = 0; } if (chunk == null || index == chunk.length) { // nothing left. return false; } return true; }
@Override public boolean isEmpty() { final IChunkedIterator<ISPO> itr = iterator(0L/* offset */, 1L/* limit */, 1/* capacity */); try { return ! itr.hasNext(); } finally { itr.close(); } }
public boolean hasNext() { while ((chunk == null || index == chunk.length) && src.hasNext()) { // fetch and filter another chunk. chunk = filter.filterChunk(src.nextChunk()); // reset the index into the current chunk. index = 0; } if (chunk == null || index == chunk.length) { // nothing left. return false; } return true; }
/** * Verify that the iterator visits the expected chunks in the expected * order. * * @param <E> * @param chunks * @param itr */ protected <E> void assertSameChunkedIterator(final E[][] chunks, final IChunkedIterator<E> itr) { for(E[] chunk : chunks) { assertTrue(itr.hasNext()); final E[] actual = itr.nextChunk(); assertSameArray(chunk, actual); } assertFalse(itr.hasNext()); }
/** * Verify that the iterator visits the expected chunks in the expected * order. * * @param <E> * @param chunks * @param itr */ protected <E> void assertSameChunkedIterator(final E[][] chunks, final IChunkedIterator<E> itr) { for(E[] chunk : chunks) { assertTrue(itr.hasNext()); final E[] actual = itr.nextChunk(); assertSameArray(chunk, actual); } assertFalse(itr.hasNext()); }
/** * {@inheritDoc} * <p> * When <code>exact == false</code> this does not count the backchained * entailments. When <code>exact == true</code> traverses the * {@link #iterator()} so as to produce an exact count of the #of elements * that would in fact be visited, which combines those from the database * with those generated dynamically (NOT efficient). */ @Override public long rangeCount(boolean exact) { if (!exact) return accessPath.rangeCount(exact); log.warn("Will materialize statements and generate inferences"); final IChunkedIterator<ISPO> itr = iterator(); long n = 0L; try { while (itr.hasNext()) { itr.next(); n++; } } finally { itr.close(); } return n; }
/** * {@inheritDoc} * <p> * When <code>exact == false</code> this does not count the backchained * entailments. When <code>exact == true</code> traverses the * {@link #iterator()} so as to produce an exact count of the #of elements * that would in fact be visited, which combines those from the database * with those generated dynamically (NOT efficient). */ @Override public long rangeCount(boolean exact) { if (!exact) return accessPath.rangeCount(exact); log.warn("Will materialize statements and generate inferences"); final IChunkedIterator<ISPO> itr = iterator(); long n = 0L; try { while (itr.hasNext()) { itr.next(); n++; } } finally { itr.close(); } return n; }
final boolean empty = ! itr.hasNext();