commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Takuya Murata <>
Subject Re: [collections] Questions....
Date Thu, 21 Aug 2003 01:43:07 GMT

> Agreed. Trying to 'package' defensively :) SingletonListIterator could
> become a static on SingletonIterator:
> SingletonIterator.asListIterator(Object) or some such. Mainly just 
> trying
> to make Collections easier to grokk.

I hate tricky solution. Compared with this, having two 
SingletonIterator and SingletonListIterator does make more sense.

>>> Second question. What's ListIteratorWrapper useful for?
>>> It seems to just let us throw a normal Iterator into something 
>>> requiring
>>> ListIterator-ness, except then it'll go ahead and throw exceptions 
>>> on most
>>> methods. So is it just an iterator that can get the previous element?
>> Yep, it allows forwards and backwards movement through any iterator, 
>> not
>> just list iterators. And no, I don't know why its useful.
> So basically a decorator pattern, but not a stunningly useful one.

Again, this looks ugly too but I don't know better solution. Remember 
adding things not only make things convenient but comes with cost of 
maintenance, documentation and difficulty to comprehend.

Takuya Murata

View raw message