Perhaps commons-collections could help you with such a task.
But I would try to put those all in a map, using that splitting/filtering property as key and a List as value:
After this block, map.values() will return a Collection of List objects containing what you are looking for.
In case the splitter property is of a custom type, make sure that type has a proper equals() and hashCode() implementations.
forums UseR
Ranch Hand
Joined: Feb 24, 2009
Posts: 169
posted
0
I can only use Java 1.4
Not sure if your code will work in my case.
Costi Ciudatu
Ranch Hand
Joined: Oct 24, 2006
Posts: 74
posted
0
For Java 4, just strip down the generics from my code.
I actually have to split the ArrayList into an array.
You need to split the ArrayList into an array of lists ? If so, map.values().toArray().
forums UseR
Ranch Hand
Joined: Feb 24, 2009
Posts: 169
posted
0
Costi Ciudatu wrote:Perhaps commons-collections could help you with such a task.
But I would try to put those all in a map, using that splitting/filtering property as key and a List as value:
Can you please explain whats going on here..., I have not worked much with Maps.., and I have only used Java 1.4