commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Takuya Murata <>
Subject Re: [collections] Questions....
Date Wed, 20 Aug 2003 01:31:49 GMT

> Firstly, SingletonIterator and SingletonListIterator seem quite 
> similar.
> Apart from the extra type of 'ListIterator', it appears that a
> SingletonListIterator can do the job of a SingletonIterator in all 
> jobs.
> Could just remove SingleIterator.

I was thinking can we eliminate those classes by methods returning 
interface? It is always a good practice to use interface rather than 
specifying concrete class. I mean just like singleton method of 

Code should be like:

class Collections2 {
   public ResetableIterator singletonIterator () { ... }
   public ResetableListIterator singletonIterator () { ... }

It is possible to use just one concrete class for both methods above.

Given there is a few discussion of code review, I think every one is 
busy maintaining the existing code base.

Takuya Murata

View raw message