This is an example of use of pick from Bag https://github.com/influence160/flera
see the classes https://github.com/influence160/flera/blob/master/flera-core/src/main/java/com/otiliouine/flera/SuccessionBasedWordGenerator.javaand https://github.com/influence160/flera/blob/master/flera-core/src/main/java/com/otiliouine/flera/analyzer/SuccessionBasedDictionaryAnalyzer.java 2013/3/13 Othmen Tiliouine <tiliouine.oth...@gmail.com> > I remplaced the patch > > 2013/3/13 Ted Dunning <ted.dunn...@gmail.com> > >> You seem to have reformatted the entire file. This makes it nearly >> impossible to review your suggested change. >> >> Can you make a diff that doesn't involve changing every line in the file? >> >> On Tue, Mar 12, 2013 at 3:48 PM, Othmen Tiliouine < >> tiliouine.oth...@gmail.com> wrote: >> >> > i puted the suggestion and attached the patch >> > >> > https://issues.apache.org/jira/browse/COLLECTIONS-448 >> > >> > 2013/3/12 Thomas Neidhart <thomas.neidh...@gmail.com> >> > >> > > On 03/12/2013 08:58 AM, Othmen Tiliouine wrote: >> > > > Thank you Ted, >> > > > >> > > > I understand from your mail that there is no particular reason that >> > makes >> > > > that the interface Bag no contains these methods and that this >> subject >> > > has >> > > > never been discussed in the mailing list. >> > > > >> > > > I'll see if I can create this patch this weekend, but i want to >> know, >> > > what do >> > > > you think what are the methods I should add >> > > > >> > > > public Object pick(); //pick random element (with remove) >> > > > public Object pickAndRemit() ; //pick random element (without >> remove) >> > > > public Collection pick(int n); //pick random n element (with remove) >> > > > public Collection pickAndRemit(int n) ; //pick random n element >> > (without >> > > > remove) >> > > > public Iterator pick(int n); //pick random n element (with remove) >> > > > public Iterator pickAndRemit(int n) ; //pick random n element >> (without >> > > > remove) >> > > > public List pick(int n); //pick random n element (with remove) >> > > > public List pickAndRemit(int n) ; //pick random n element (without >> > > remove) >> > > > public Bag pick(int n); //pick random n element (with remove) >> > > > public Bag pickAndRemit(int n) ; //pick random n element (without >> > remove) >> > > > >> > > > maby i must provide the two kind of methods ( Bag pick(int n) and >> > > Iterator >> > > > pickOrdered(int n) ) ? >> > > > >> > > > >> > > > there is something I do not understand why the bag does not use >> > generics >> > > ? >> > > >> > > the current version of collections in the trunk is already adapted to >> > > generics. We are currently in the process of preparing a release >> (4.0). >> > > >> > > So when you provide a patch, please align it to the version in the >> trunk. >> > > >> > > Thomas >> > > >> > > --------------------------------------------------------------------- >> > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org >> > > For additional commands, e-mail: dev-h...@commons.apache.org >> > > >> > > >> > >> > >