Re: [collections] LoopingIterator

2002-11-21 Thread scolebourne
Hmmm, yes you are right. Concurrent modifications will cause problems. The remove method on the looping iterator can be handled however (re-check if size == 0) and set the flag. Stephen from:Jeff Varszegi [EMAIL PROTECTED] I don't see how to implement this without being horribly

Re: [collections] LoopingIterator

2002-11-21 Thread Jonathan Carlson
This was my take on it: Since it uses the iterator provided by the collection, I felt it would be wasteful to try to provide any greater protection than that already provided by the collection's own iterator (other than the stated benefit of allowing one to continually loop over the collection).

Re: [collections] LoopingIterator

2002-11-21 Thread Stephen Colebourne
- Original Message - From: Jeff Varszegi [EMAIL PROTECTED] To: Jakarta Commons Developers List [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 21, 2002 10:38 PM Subject: Re: [collections] LoopingIterator I agree with you about the protection. It can be a snapshot view

Re: [collections] LoopingIterator

2002-11-20 Thread Jeff Varszegi
I don't see how to implement this without being horribly wasteful (checking every value in the collection backing the Iterator every time something is returned, getting a new Iterator every time through the loop, etc.). The thing is, you can't even depend on the implementation of hashCode()

Re: [collections] LoopingIterator

2002-11-14 Thread Stephen Colebourne
Jonathan, I was going to include your files in the CVS. However, I discovered that they do not cope with the situation where the collection being wrapped is altered. ie. hasNext() always returns the initially cached value, even if the list is clear()ed or it.remove() is called. Can you sort this?

Re: [collections] LoopingIterator

2002-11-01 Thread Stephen Colebourne
From: Jonathan Carlson [EMAIL PROTECTED] I can add a remove method and test cases unless it's easier for you to just add it. I think it would just use the remove method on the Collection. If the iterator returned by the Collection implementer doesn't support it then this won't either. If

Re: [collections] LoopingIterator

2002-11-01 Thread Jonathan Carlson
It is attached with updated unit tests. It was so easy that I'm surprised I didn't implement the remove() in the first place. Thanks! Jonathan Carlson Minneapolis, Minnesota --- Stephen Colebourne [EMAIL PROTECTED] wrote: From: Jonathan Carlson [EMAIL PROTECTED] I can add a remove method

Re: [collections] LoopingIterator

2002-10-31 Thread Jonathan Carlson
I'm very sorry to have taken so long to reply. I don't check this box very often and I am deep into development so checking it even less. I'll check back tomorrow for a reply. I can add a remove method and test cases unless it's easier for you to just add it. I think it would just use the

Re: [collections] LoopingIterator

2002-10-31 Thread Jonathan Carlson
Oops, I meant to say: I think it [the remove method] would need to use the remove method on the iterator returned by the Collection. Jonathan --- Jonathan Carlson [EMAIL PROTECTED] wrote: I'm very sorry to have taken so long to reply. I don't check this box very often and I am deep into

Re: [collections] LoopingIterator

2002-10-22 Thread Steve Downey
On Friday 18 October 2002 06:45 pm, Stephen Colebourne wrote: [Jonathan, I have sent back to commons-dev mailing list which is the appropriate place for design/code discussions.] I took a quick look, and I believe that the code in the zip will work. However, my main concern is why this would

[collections] LoopingIterator

2002-10-18 Thread Stephen Colebourne
[Jonathan, I have sent back to commons-dev mailing list which is the appropriate place for design/code discussions.] I took a quick look, and I believe that the code in the zip will work. However, my main concern is why this would be needed. Is there a use case for an iterator that never ends? I