commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections][SUBMIT] class 'RandomCollection'
Date Sun, 24 Nov 2002 22:37:07 GMT
I am not currently planning on including RandomCollection in [collections].
As Rodney pointed out, it seems to do the same as Collections.shuffle. If
you want to pursue it, can you specify the differences/benefits and use
cases?

I might be more amenable to a decorator implementation (see the inner
classes in CollectionUtils). As it seems to be the iterator that would be
the only difference. eg. a randomCollection(Collection) method that
decorates the original collection, overriding the iterator method to return
the elements once, but in a shuffled order. LoopingIterator, from
IteratorUtils, could be used on the decorated collection if you want a
looping random collection.

Stephen

----- Original Message -----
From: "Tim O'Brien" <tobrien@transolutions.net>
> You asked, so I'll reply, this is not junk.  I was previously using the
> RandomIterator from the WASA project on SourceForge, and I'm going to
> immediately switch to this RandomCollection.  I'm using your
> RandomCollection for efficient tree population.
>
> I noticed your previous reply to the question about the LoopingIterator
> where you mentioned that you were trying to implement a RandomIterator but
> there were problems with concurrency, etc.  I assume that on further
> thought you decided to tackle the problem from the collection end of the
> problem.
>
> Thanks
>
> Tim
>
>
>
> On Thu, 21 Nov 2002, Jeff Varszegi wrote:
>
> > It's a place you can dump things and get them back in random order, over
and over again if you
> > wish.  I've used it in the past, and just thought I'd get some javadoc
together and show it to you
> > all in case you think it would be useful.  Includes the Apache software
license-- see, I'm getting
> > better all the time!  :O)  Let me know if it's junk or not.
> >
> > Jeff
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
>
> --
> ----------------------
> Tim O'Brien
> Evanston, IL
> (847) 863-7045
> tobrien@discursive.com
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message