I have a List of Arrays, like this one:
List<String[]> myList = new ArrayList<String[]>();
myList.add( new String[]{"A1","B1","C1","D1","values"} );
myList.add( new String[]{"A1","B1","C2","D1","values"} );
myList.add( new String[]{"A1","B1","C2","D2","values"} );
myList.add( new String[]{"A2","B1","C1","D1","values"} );
myList.add( new String[]{"A2","B1","C1","D2","values"} );
I need fill An Object that have dependences with the fathers, so:
- A1 have only one child, B1.
- B1 have 2 children, C1 and C2.
- C1 have 1 child, D1, that have the values…
- C2 have 2 children, D1 and D2, that have the values…
- B1 have 2 children, C1 and C2.
- A2 have only one child, B1 (Not the same that the other one)
- B1 have only one child, C1… etc.
What kind of structure do you think is better? I need the names A1, B1, etc.
I have probe with Maps, Arrays, Lists… I think that the algorithm is not possible… π π
Please, HELP!
Edit explaining:
I have a ResultSet from a DataBase that have 5 or 6 GROUP BY clauses. I have all the plain data and
I need to make an structure with Text Objects, for example:
Person A - Building 1 - Tower 1 - Some Text A
Person A - Building 1 - Tower 2 - Another Text
Person A - Building 2 - Tower 1 - Another one Text
Person A - Building 2 - Tower 3 - My Text
Person B - Building 1 - Tower 2 - Any Text
Person B - Building 3 - Tower 1 - A Text...
I need an Object structure for this data… Is it possible?
I DID IT ! OH MY GOD! π π π π π π :D…