I need help to find the better way to sort my array and show it on the screen. Here is the complex object:
Category category;
Article article;
BigDecimal price;
And I want to show an Array of this object on this way:
Category
->Article
->Price
->Article
->Price
->Price
->Article
->Price
Category
->Article
->Price
->Price
->Article
->Price
So, heres a example of array (Category and Article objects have Id's, but im gonna use name so its gonna be more easy to understand):
{"Kitchen", "Fork", 5}
{"Kitchen", "Fork", 8}
{"Kitchen", "Knife", 5}
{"Kitchen", "Spoon", 3}
{"Bathroom", "Soap", 5}
{"Bathroom", "Shampoo", 3}
{"Bathroom", "Shampoo", 7}
So, I want to show it like this:
Kitchen
->Fork
->5
->8
->Knife
->5
->Spoon
->3
Bathroom
->Soap
->5
->Shampoo
->3
->7
I know, im not posting any code, but its because I dont know how to do it. Maybe making a lot of loops, but im here for suggestions..
Sorry for my bad english, I hope you understand!