Re: [collections] Questions....

2003-08-21 Thread Rich Dougherty
On Wed, Aug 20, 2003 at 10:25:39AM -0400, Henri Yandell wrote: > > > FastXxx classes say that they are not cross-platform, but in no way > > > discuss which platforms they are targetted at. This makes these classes > > > useless except to the authors. > > IIRC, nobody can ever answer this question.

Re: [collections] Questions....

2003-08-20 Thread Takuya Murata
I personally have a problem with the use of the class name Singleton. Singleton is a well known pattern for only having one instance of an Object in an environment, this class does not achive this. I would think a name likeSingleEntryIterator/TrivialIterator/MonoIterator or some such would be a

Re: [collections] Questions....

2003-08-20 Thread Takuya Murata
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

RE: [collections] Questions....

2003-08-20 Thread Hope, Matthew
Subject: RE: [collections] Questions > > > > -Original Message- > > From: Takuya Murata [mailto:[EMAIL PROTECTED] > > Sent: 20 August 2003 12:14 > > To: Jakarta Commons Developers List > > Subject: Re: [collections] Questions > > > > c

Re: [collections] Questions....

2003-08-20 Thread Henri Yandell
On Tue, 19 Aug 2003, Stephen Colebourne wrote: > From: "Henri Yandell" <[EMAIL PROTECTED]> > > 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 SingletonIterat

RE: [collections] Questions....

2003-08-20 Thread Hope, Matthew
> -Original Message- > From: Takuya Murata [mailto:[EMAIL PROTECTED] > Sent: 20 August 2003 12:14 > To: Jakarta Commons Developers List > Subject: Re: [collections] Questions > > class Singleton implements List { > } > > ResetableIterator i = new Singl

RE: [collections] Questions....

2003-08-20 Thread Hope, Matthew
> -Original Message- > From: Takuya Murata [mailto:[EMAIL PROTECTED] > Sent: 20 August 2003 11:55 > To: Jakarta Commons Developers List > Subject: Re: [collections] Questions > > A tricky situation is > > class A { >public void method (Iterat

Re: [collections] Questions....

2003-08-20 Thread Takuya Murata
this sounds hugely dangerous - the javadocs for List#equals(Object) for example stipulate: Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two

Re: [collections] Questions....

2003-08-20 Thread Takuya Murata
On Wednesday, August 20, 2003, at 12:41 PM, Henri Yandell wrote: On Wed, 20 Aug 2003, Takuya Murata wrote: 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 SingletonIterat

RE: [collections] Questions....

2003-08-20 Thread Hope, Matthew
> -Original Message- > From: Takuya Murata [mailto:[EMAIL PROTECTED] > Sent: 20 August 2003 04:29 > To: Jakarta Commons Developers List > Subject: Re: [collections] Questions > > > Hi, > > So the question is do we really need SingletonIterator

Re: [collections] Questions....

2003-08-20 Thread Stephen Colebourne
From: "Henri Yandell" <[EMAIL PROTECTED]> > 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. True,

Re: [collections] Questions....

2003-08-19 Thread Rich Dougherty
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

Re: [collections] Questions....

2003-08-19 Thread __matthewHawthorne
I think that the elimination of _unnecessary_ methods and classes is a noble goal. For example, In the SingletonIterator vs. SingletonListIterator situation, as long as the logic to implement the extra methods specified by java.util.ListIterator does not cause significant performance overhead, i

Re: [collections] Questions....

2003-08-19 Thread Henri Yandell
On Wed, 20 Aug 2003, Takuya Murata wrote: > 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.

Re: [collections] Questions....

2003-08-19 Thread Takuya Murata
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

Re: [collections] Questions....

2003-08-19 Thread Henri Yandell
While this is a good question, it's not the actual problem I'm trying to point out. SingletonIterator or singletonIterator() is a redundant method in 99% of its usage. Only if someone has if(instanceof ListIterator) {.. } else if(instanceof Iterator) would it change the funcationality. Using XxxU

Re: [collections] Questions....

2003-08-19 Thread Takuya Murata
Hello, 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