Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:34:31+00:00 2026-05-22T19:34:31+00:00

I have a List of Arrays, like this one: List<String[]> myList = new ArrayList<String[]>();

  • 0

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…
  • 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:34:32+00:00Added an answer on May 22, 2026 at 7:34 pm

    I DID IT ! OH MY GOD! πŸ˜€ πŸ˜€ πŸ˜€ πŸ˜€ πŸ˜€ πŸ˜€ :D…

    private static void finalFillerTotalSuperSpecial(List<String[]> initialList, HashMap<String,Object> mapa){
    
         String[] currentElement = null;
         String currentKey = null;
    
         String[] nextElement = null;
         String nextKey = null;
         int i=0,start,end;
    
         while (i < initialList.size()) {
         start = i;
    
         currentElement = initialList.get( i++ );
         currentKey = currentElement[0];
    
         if (i<initialList.size()){
             nextElement = initialList.get( i );
             nextKey = nextElement[0];
         }
    
         HashMap<String,Object> insideMap = new HashMap<String,Object>(); 
         mapa.put(currentKey, insideMap);
    
         while (currentKey.equals(nextKey) && i < initialList.size()) {
             currentElement = initialList.get( i++ );
             currentKey = currentElement[0];
    
             if (i<initialList.size()){
             nextElement = initialList.get( i );
             nextKey = nextElement[0];
             }
    
         }
         end = i;
    
         List<String[]> listOfCurrentElements = new ArrayList<String[]>();
         for (int j=start;j<end;j++)
             listOfCurrentElements.add( getNextArray(initialList.get(j)) );
    
         if ( listOfCurrentElements.get(0).length>1 )
             finalFillerTotalSuperSpecial(listOfCurrentElements,insideMap);
         else
             insideMap.put(listOfCurrentElements.get(0)[0], null);
         }
    
    
    
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: TEST.DATA.Data.COR.Point,2;TEST.DATA.Data.COR.Point,5;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.WordTOFIND,18 I have a list of array with
I have an array list of objects in my application. private static ArrayList<Player> userList=new
Assume you are doing something like the following List<string> myitems = new List<string> {
I have a List of objects which contain a string array as one of
I have a string like this being returned from my backend: 1,2,3,4,5,6 I have
I have a list comprehension operating on elements of an .NET array like obj.arr
C++ Notes: Array Initialization has a nice list over initialization of arrays. I have
I have an array of strings var controlsToGet = new[] {lblHome,lblContact}; I have List<LanguageControl>
Closed as exact duplicate of this question . I have an array/list of elements.
I have about 200 String values and each string needs to be placed into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.