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


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to