> From: [email protected]
> To: [email protected]
> Subject: RE: com.hp.hpl.jena.query.ResultSet nested loop
> Date: Tue, 17 May 2011 11:12:35 +0000
>
>
>
>
> > Date: Tue, 17 May 2011 12:04:32 +0100
> > From: [email protected]
> > To: [email protected]
> > Subject: Re: com.hp.hpl.jena.query.ResultSet nested loop
> >
> >
> >
> > On 17/05/11 11:53, Jorge Christodoulou wrote:
> > >
> > > Hi, I have ResultSet a and ResultSet b
> > > (com.hp.hpl.jena.query.ResultSet) for(; a.hasNext() ;){ String s_a =
> > > a.nextSolution().get(commonVars.get(0)).toString(); for(;
> > > b.hasNext()
> > > ;){ String s_b =
> > > b.nextSolution().get(commonVars.get(0)).toString();
> > > if(s_a.equalsIgnoreCase(s_b)) ..... }} The problem
> > > is that it gets
> > > in the second loop only for the first iteration of the first loop.Is
> > > this because Iterators are single use only and what can i do if so?
> > > Any ideas will be helpfull.
> >
> > (unreadable)
> >
> > If a and b are the same ResultSet (iterator), then yes, ResultSets are
> > use-once. See ResultSetFacory.makeRewindable
> >
> > Andy
>
> a and b are both com.hp.hpl.jena.query.ResultSet but they have different
> results inside...(if this is what you ask???)Rewindable has only extra method
> reset() and size() and doesn't seem to help
>
Τhe second loop is inside the first one...Sorry, I just show the appearence of
the syntax...