public class LazyMutableClosableIteration extends Object implements CloseableIteration<BindingSet,QueryEvaluationException>
CloseableIteration that allows repetitive iterations after resetting the cursor using
resetCursor().
Note that the inner iteration is lazily consumed.
| Modifier and Type | Field and Description |
|---|---|
protected List<BindingSet> |
consumed |
protected int |
cursorIdx
the cursor index, is used after the inner iteration is fully consumed
|
protected CloseableIteration<BindingSet,QueryEvaluationException> |
inner |
| Constructor and Description |
|---|
LazyMutableClosableIteration(CloseableIteration<BindingSet,QueryEvaluationException> inner) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this iteration, freeing any resources that it is holding.
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
BindingSet |
next()
Returns the next element in the iteration.
|
void |
remove()
Removes from the underlying collection the last element returned by the iteration (optional operation).
|
void |
resetCursor()
Reset the cursor to read from the already consumed bindings.
|
protected final CloseableIteration<BindingSet,QueryEvaluationException> inner
protected List<BindingSet> consumed
protected volatile int cursorIdx
public LazyMutableClosableIteration(CloseableIteration<BindingSet,QueryEvaluationException> inner)
public boolean hasNext()
throws QueryEvaluationException
IterationIteration.next()
would return an element rather than throwing a NoSuchElementException.)hasNext in interface Iteration<BindingSet,QueryEvaluationException>QueryEvaluationExceptionpublic BindingSet next() throws QueryEvaluationException
Iterationnext in interface Iteration<BindingSet,QueryEvaluationException>QueryEvaluationExceptionpublic void remove()
throws QueryEvaluationException
Iterationremove in interface Iteration<BindingSet,QueryEvaluationException>QueryEvaluationExceptionpublic void close()
throws QueryEvaluationException
CloseableIterationclose in interface AutoCloseableclose in interface CloseableIteration<BindingSet,QueryEvaluationException>QueryEvaluationExceptionpublic void resetCursor()
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.