public class MutableTupleQueryResult extends Object implements TupleQueryResult, Cloneable
TupleQueryResult
interface that stores the complete query result in memory. The
query results in a MutableTupleQueryResult can be iterated over multiple times and can also be iterated over in
reverse order.Constructor and Description |
---|
MutableTupleQueryResult(Collection<String> bindingNames,
BindingSet... bindingSets) |
MutableTupleQueryResult(Collection<String> bindingNames,
Collection<? extends BindingSet> bindingSets)
Creates a query result table with the supplied binding names.
|
MutableTupleQueryResult(Collection<String> bindingNames,
Iteration<? extends BindingSet,E> bindingSetIter) |
MutableTupleQueryResult(TupleQueryResult tqr) |
Modifier and Type | Method and Description |
---|---|
void |
afterLast()
Moves the cursor to the end of the query result, just after the last binding set.
|
void |
append(BindingSet bindingSet) |
void |
beforeFirst()
Moves the cursor to the start of the query result, just before the first binding set.
|
void |
clear() |
MutableTupleQueryResult |
clone() |
void |
close()
Closes this iteration, freeing any resources that it is holding.
|
BindingSet |
get(int index) |
List<String> |
getBindingNames()
Gets the names of the bindings, in order of projection.
|
int |
getIndex() |
boolean |
hasNext()
Returns true if the iteration has more elements.
|
boolean |
hasPrevious() |
void |
insert(BindingSet bindingSet)
Inserts the specified binding set into the list.
|
void |
insert(int index,
BindingSet bindingSet) |
BindingSet |
next()
Returns the next element in the iteration.
|
BindingSet |
previous() |
void |
remove()
Removes from the underlying collection the last element returned by the iteration (optional operation).
|
BindingSet |
remove(int index) |
void |
set(BindingSet bindingSet) |
BindingSet |
set(int index,
BindingSet bindingSet) |
void |
setIndex(int index) |
int |
size() |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
iterator
forEach, spliterator
public MutableTupleQueryResult(Collection<String> bindingNames, BindingSet... bindingSets)
public MutableTupleQueryResult(Collection<String> bindingNames, Collection<? extends BindingSet> bindingSets)
bindingNames
- The binding names, in order of projection.public MutableTupleQueryResult(Collection<String> bindingNames, Iteration<? extends BindingSet,E> bindingSetIter) throws E extends Exception
E extends Exception
public MutableTupleQueryResult(TupleQueryResult tqr) throws QueryEvaluationException
QueryEvaluationException
public List<String> getBindingNames()
TupleQueryResult
getBindingNames
in interface TupleQueryResult
public int size()
public BindingSet get(int index)
public int getIndex()
public void setIndex(int index)
public boolean hasNext()
Iteration
Iteration.next()
would return an element rather than throwing a NoSuchElementException.)hasNext
in interface Iteration<BindingSet,QueryEvaluationException>
public BindingSet next()
Iteration
next
in interface Iteration<BindingSet,QueryEvaluationException>
public boolean hasPrevious()
public BindingSet previous()
public void beforeFirst()
public void afterLast()
public void insert(BindingSet bindingSet)
next()
, if any, and after the next element that would be returned by
previous()
, if any. (If the table contains no binding sets, the new element becomes the sole element on
the table.) The new element is inserted before the implicit cursor: a subsequent call to next() would be
unaffected, and a subsequent call to previous() would return the new binding set.bindingSet
- The binding set to insert.public void insert(int index, BindingSet bindingSet)
public void append(BindingSet bindingSet)
public void set(BindingSet bindingSet)
public BindingSet set(int index, BindingSet bindingSet)
public void remove()
Iteration
remove
in interface Iteration<BindingSet,QueryEvaluationException>
public BindingSet remove(int index)
public void clear()
public void close()
CloseableIteration
close
in interface AutoCloseable
close
in interface CloseableIteration<BindingSet,QueryEvaluationException>
public MutableTupleQueryResult clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.