This discussion is archived
3 Replies Latest reply: May 10, 2007 4:28 AM by 800322 RSS

problem in displaying values of hash table....urgent

807606 Newbie
Currently Being Moderated
public Hashtable DabbleFilesParser()
{     
     try{
//data taken from processini.dab
          java.util.Map ProcessMap = (java.util.Map) getProperty(QueueConstants.PROCESS_MAP);
          
          java.util.Iterator it1 = ProcessMap.keySet().iterator();
while (it1.hasNext()) {
                    String ProcessName = (String) it1.next();
                    //System.out.println("-----------------------------");
                    //System.out.println(ProcessName);
                    QueueNamesInProcessini.clear();

                    java.util.Map ProcessNameMap = (java.util.Map) ProcessMap.get(ProcessName);
                         
                         //obtaining the unique queue names with queue managaer     
                         if(ProcessNameMap.containsKey(QueueConstants.SEND_QUEUELIST)) {
                         java.util.ArrayList QueueNameInProcessDab1 =
                              (java.util.ArrayList) ProcessNameMap.get(QueueConstants.SEND_QUEUELIST);
                              java.util.Iterator it11 = QueueNameInProcessDab1.iterator();
                              while (it11.hasNext()) {
                              String QueueName =     (String) it11.next();
                              QueueNamesInProcessini.add(QueueName);
                              }
                         }
                              
                         if(ProcessNameMap.containsKey(QueueConstants.SENDUX_QUEUELIST)) {
                         java.util.ArrayList QueueNameInProcessDab2 =
                              (java.util.ArrayList) ProcessNameMap.get(QueueConstants.SENDUX_QUEUELIST);
                              java.util.Iterator it12 = QueueNameInProcessDab2.iterator();
                              while (it12.hasNext()) {
                              String QueueName = (String) it12.next();
                              QueueNamesInProcessini.add(QueueName);
                              }
                         }

                         if(ProcessNameMap.containsKey(QueueConstants.RECV_QUEUELIST)) {
                         java.util.ArrayList QueueNameInProcessDab3 =
                              (java.util.ArrayList) ProcessNameMap.get(QueueConstants.RECV_QUEUELIST);
                              java.util.Iterator it13 = QueueNameInProcessDab3.iterator();
                              while (it13.hasNext()) {
                              String QueueName =     (String) it13.next();
                              QueueNamesInProcessini.add(QueueName);
                              }
                         }
                                   /*java.util.Iterator it32 = QueueNamesInProcessini.iterator();
                                   while (it32.hasNext()) {
                                   String QueueDetailName = (String) it32.next();
                                   System.out.println(QueueDetailName);
                                   }*/

                    details1.put(ProcessName,QueueNamesInProcessini);
                                        
                    /*java.util.Vector QueueDetail =
                                   (java.util.Vector) details1.get(ProcessName);
                                   java.util.Iterator it32 = QueueDetail.iterator();
                                   while (it32.hasNext()) {
                                   String QueueDetailName = (String) it32.next();
                                   System.out.println(QueueDetailName);
                                   }*/
                    }

                    java.util.Iterator it31 = details1.keySet().iterator();
                    while (it31.hasNext()) {
                                   String ProcessName = (String) it31.next();
                                   System.out.println("------------");
                                   System.out.println(ProcessName);
                                   
                    java.util.Vector QueueDetail =
                                   (java.util.Vector) details1.get(ProcessName);
                                   java.util.Iterator it32 = QueueDetail.iterator();
                                   while (it32.hasNext()) {
                                   String QueueDetailName = (String) it32.next();
                                   System.out.println(QueueDetailName);
                                   }
                    }

this is accessing dabble file and printing them on screen or inserting in db or displaying on web page
but the problrm is that whe i iterate the mappings taken from the dabble file all come out clearly as i checked them using println and even the get mapped in side the new hash table i created but once i come out of the loop and try displaying them then im getting only the last values mapped to all the keys.
the keys are correct in the table but the values i get for each key is same as the values for the last key....
im stucl up with this for 1.5 days and my proj end date is coming monday .... can anyone help me out with this?