Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
I have a HashTable that I would like to create an ArrayLIst, for each key

I have a hashtable. Inside I've added keys, and values. But now I need to have an arrayList for each keyvalue. I was thinking I needed to create an ArrayList with the ArrayList name from the hashtable key and the contents of the hashtable values placed inside values. I'm using Ultra-Studio to make modifications to this script file. So for instance in my hashtable This will be the name of the ArrayList: SW_Version
Second all SW Version values will be added SW_Version I think what I need to do is first cycle through the hashtable gather all the SW Versions values and put them in I'm very confused on this, please be patient with me. I have to write my JAVA code in an javaScript file

I wanted to pull data directly from the hashTable, I would also need to group the keys and add the values into the arrayList.

Here are my Hashtable and ArrayList declaration.

   var legendRows = newPackages.java.util.ArrayList();
   var xmlItems = newPackages.java.util.ArrayList();
   var modeItems = newPackages.java.util.ArrayList();
   var ircDOORSHashTable = newjava.util.Hashtable();

This is my code:

This function gets the "Legacy Data" value from a procedure bean. It then adds the table cell values into the HashTable "ircDOORSHashTable".

  • Cell key = var mapKeyDOORS

  • Cell value = mapKeyDOORSValue

       function getDOORSData(documentID, contentBean, text) {
      var xmlText = cleanTable(text);
      try
      {
          var docFactory = Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance();
          var docBuilder = docFactory.newDocumentBuilder();
          var sbis = newPackages.org.xml.sax.InputSource(newjava.io.StringReader(xmlText));
          var document = docBuilder.parse(sbis);
          var root = document.getDocumentElement();
          varnodeList = root.getElementsByTagName("tr");
          for (row = 0; row < nodeList.getLength(); row++) {
              var node = nodeList.item(row);
              var mapKeyDOORS = newjava.lang.String(node.getElementsByTagName("td").item(0).getTextContent().trim());
              var mapKeyDOORSValue = newjava.lang.String(node.getElementsByTagName("td").item(1).getTextContent().trim());
              if((mapKeyDOORS !== null && mapKeyDOORS!=="") && (mapKeyDOORSValue!== null || mapKeyDOORSValue !== "")){
                  // Returnsanarrayoflineitems.
                  varibplValues = parseFields(mapKeyDOORSValue);
    
                  for (varf = 0; f < ibplValues.length; f++) {
                      log("InsidegetDOORSDatafunction. InfirstPass")
                      checkIBPL(ibplValues[f], documentID, contentBean, mapKeyDOORS);
                  }else{
                      log("ArrayList xmlItem: " + ibplValues[i]);
                      xmlItems.add(ibplValues[f]);
                      ircDOORSHashTable.put(mapKeyDOORS, ibplValues[i]);
                  }
              }
          }
      }
    

    }catch(e){ log ("ErrorfoundingetDOORSDatafunction " + e); } }

Thankyou, your help is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!