Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda