[Rxtx] NRJavaSerial, a fork of rxtx that fixes the papercuts!
jredman at ergotech.com
Mon Mar 28 11:57:03 MDT 2011
Am I wrong in thinking that if you use a List and so return a
ListIterator both the add and remove will be there? Yes, you'd have to
cast it to use the add, but never underestimate the "creativeness" of users.
Regardless, unless you return your own Iterator implementation for a
List, I don't think that the remove method will throw.
I think that returning your own implementation would come under the
category of "handling" the problem and is certainly a solution.
On 03/28/2011 11:41 AM, Kustaa Nyholm wrote:
> On 3/28/11 20:22, "Jim Redman"<jredman at ergotech.com> wrote:
>> An Iterator (probably) allows modification of the underlying object
> Which iterator is that?
> java.util.Iterator only supports hasNext,next and optionally remove which
> can throw UnsupportedOperationException if you don't want to / cannot
>> An Enumeration does not.
>> If you're going to return a List Iterator, you need to handle the
>> mutability of the underlying Collection.
> As I understand java.util.Iterator this is a non issue.
> br Kusti
> Rxtx mailing list
> Rxtx at qbang.org
(505) 662 5156 x85
More information about the Rxtx