commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Takuya Murata <tak...@manjiro.net>
Subject Re: [collections] Questions....
Date Wed, 20 Aug 2003 03:28:47 GMT
Hi,

So the question is do we really need SingletonIterator and such. If we 
want to eliminate the number of methods or classes, then what about one 
class for all of collections or iterators? I suppose the use of 
singleton methods and classes is almost always to provide an object 
matching a data type you want. Thus, we can have a class like

class Singleton implements List, SortedSet, Bag, Iterator, ListIterator 
{
}

Although it is usually bad practice to aggregate several different 
functionalities into one class, in this case, it might be fine.

Yes, this is in line with your proposal; we can use 
SingletonListIterator for both Iterator and ListIterator. I think the 
problem of this solution is users probably expect SingletonIterator 
intuitively and might be puzzled why there is no such.

Takuya Murata


Mime
View raw message