Re: [collections] Iterate over sublists of an original list

2011-08-19 Thread Sébastien Lorber
Hello, Sorry but i don't know so much about open source contributions yet... If i think a feature is missing, should i make a pull request or something or wait for the approval on this mailing list? It seems that it would be kinda easy to implement these functions that are available in scala...

Re: [collections] Iterate over sublists of an original list

2011-08-18 Thread Sébastien Lorber
That's true. The grouped() method in scala do exactly that. I agree, these functions are quite useful that's why i sent a mail: to see if we can integrate them in apache libs 2011/8/18 Matthew Pocock > The scala collections library has the grouped() method. From the scaladoc: > > defgrouped (

Re: [collections] Iterate over sublists of an original list

2011-08-18 Thread Matthew Pocock
The scala collections library has the grouped() method. From the scaladoc: defgrouped (size: Int ): Iterator [List

Re: [collections] Iterate over sublists of an original list

2011-08-18 Thread Sébastien Lorber
Hello Actually if you look at my implementation, i use that List.sublist() method. It's a little pain to use it to split because you must always take care of an out of bound... IMHO, people do not really like to play with array/list indexes... If they just want to split a big list of a couple of

Re: [collections] Iterate over sublists of an original list

2011-08-18 Thread David Karlsen
Guava also has a lot of handy classes for working on collections. 2011/8/18 Simone Tripodi > Salut Sébastien, > wouldn't the List#subList(int, int)[1] method be helpful for your purposes? > HTH, > Simo > > [1] > http://download.oracle.com/javase/1.5.0/docs/api/java/util/List.html#subList(int > ,

Re: [collections] Iterate over sublists of an original list

2011-08-18 Thread Simone Tripodi
Salut Sébastien, wouldn't the List#subList(int, int)[1] method be helpful for your purposes? HTH, Simo [1] http://download.oracle.com/javase/1.5.0/docs/api/java/util/List.html#subList(int, int) http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Thu, Aug 18, 2011 at 2:26 PM, S

[collections] Iterate over sublists of an original list

2011-08-18 Thread Sébastien Lorber
Hello, It's not the first time i have to split a big list of hibernate entities ID's to sublists of 100 items for exemple so that i could load all these entities 100 in a single request (with a "where id in (") Thus I want to iterate easily on sublists of a list, with the possibility to give the