On 17/05/11 17:09, Jorge Christodoulou wrote:
Hi, the ResultSet man again :)Is it possible to remove a "row" from a
com.hp.hpl.jena.query.ResultSet during a for loop?
I tried:
for(; rSet.hasNext() ;){
if(listCSD.contains(rSet.nextSolution().get(commonVars.get(0)).toString()))
rSet.remove(); }
but it throws this exception:java.lang.UnsupportedOperationException:
ResultSetMem: Attempt to remove an element
No, it's not possible.
Convert to an array (Iter.toList) and manipulate that.
As you want to rerun over the results multiple times, maybe a better
design is to get the results, transfer to a List<>.
Andy