@Override public void remove() { i.remove(); }
/** Are there any more acceptable objects. * @return true if there is another acceptable object. */ @Override synchronized public boolean hasNext() { if (current!=null) return true; while ( underlying.hasNext() ) { current = f.accept( underlying.next() ); if (current != null) return true; } current = null; dead = true; return false; }
/** If <code>it</code> is a Closableiterator, close it. Abstracts away from tests [that were] scattered through the code. */ public static void close( Iterator<?> it ) { if (it instanceof ClosableIterator<?>) ((ClosableIterator<?>) it).close(); }
@Override protected boolean hasNextBinding() { boolean isMore = graphIter.hasNext() ; return isMore ; }
@Override protected Binding moveToNextBinding() { Domain d = graphIter.next() ; Binding b = graphResultsToBinding(binding, d, projectionVars) ; return b ; }
/** Utility method: answer true iff we can find at least one instantiation of the triple in this graph using find(TripleMatch). @param t Triple that is the pattern to match @return true iff find(t) returns at least one result */ final protected boolean containsByFind( Triple t ) { ClosableIterator<Triple> it = find( t ); try { return it.hasNext(); } finally { it.close(); } }
@Override public void close() { underlying.close(); }
@Override public boolean hasNext() { return i.hasNext(); }
@Override public T next() { T x = i.next(); try { seen.add( x ); } catch (OutOfMemoryError e) { throw e; } return x; }
/** Utility method: answer true iff we can find at least one instantiation of the triple in this graph using find(TripleMatch). @param t Triple that is the pattern to match @return true iff find(t) returns at least one result */ final protected boolean containsByFind( Triple t ) { ClosableIterator<Triple> it = find( t ); try { return it.hasNext(); } finally { it.close(); } }
@Override public void close() { i.close(); } };
@Override public boolean hasNext() { assert this.modelImplJena.getModificationCount() == this.modelModificationCountAtCreationTime : "concurrent modification for iterator (" + this.modelModificationCountAtCreationTime + " but model is " + this.modelImplJena.getModificationCount() + ")"; return this.it.hasNext(); }
@Override public Statement next() { assert this.modelImplJena.getModificationCount() == this.modelModificationCountAtCreationTime; Triple t = (Triple)this.it.next(); return new StatementJena29Impl(this.modelImplJena, t.getSubject(), t.getPredicate(), t .getObject()); }
/** remove's the member from the underlying <CODE>Iterator</CODE>; <CODE>hasNext()</CODE> may not be called between calls to <CODE>next()</CODE> and <CODE>remove()</CODE>. */ @Override synchronized public void remove() { if ( current != null || dead ) throw new IllegalStateException( "FilterIterator does not permit calls to hasNext between calls to next and remove."); underlying.remove(); } /** The next acceptable object in the iterator.