commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Brisson <cla...@renegat.net>
Subject Re: How can I split a List into sub-lists
Date Thu, 05 Jun 2008 19:26:41 GMT
The right answer is : you can do it yourself, with or without class.

For instance (pseudocode) :

left = list.sublist(0,middle)
right = list.sublist(middle,end)
for i in {0..length}
    result.add(new list({left(i),right(i)}))

that difficult?


    Claude

Le jeudi 05 juin 2008 à 20:41 +0200, Zsolt Koppany a écrit :
> Hi,
> 
> I would like to split a list like below:
> 
> {A1 A2 A3 B1 B2 B3} into
> 
> {
>  {A1 B1}
>  {A2 B2}
>  {A3 B3}
> }
> 
> Which class can do that?
> 
> Zsolt 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message