svn commit: r13643 - trunk/src_new/org/argouml: persistence uml/diagram uml/generator/ui uml/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2007-10-07 04:08:40-0700
New Revision: 13643

Modified:
   trunk/src_new/org/argouml/persistence/PGMLStackParser.java
   trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java
   trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java
   trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java

Log:
Switching from keySet iterator to entrySet iterator, improving performance.

Modified: trunk/src_new/org/argouml/persistence/PGMLStackParser.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/PGMLStackParser.java?view=diff&rev=13643&p1=trunk/src_new/org/argouml/persistence/PGMLStackParser.java&p2=trunk/src_new/org/argouml/persistence/PGMLStackParser.java&r1=13642&r2=13643
==============================================================================
--- trunk/src_new/org/argouml/persistence/PGMLStackParser.java	(original)
+++ trunk/src_new/org/argouml/persistence/PGMLStackParser.java	2007-10-07 04:08:40-0700
@@ -257,10 +257,11 @@
     private void setStyleAttributes(Fig fig, Map attributeMap) {
         String name;
         String value;
-        Iterator it = attributeMap.keySet().iterator();
+        Iterator it = attributeMap.entrySet().iterator();
         while (it.hasNext()) {
-            name = (String) it.next();
-            value = (String) attributeMap.get(name);
+            Map.Entry entry = (Map.Entry) it.next();
+            name = (String) entry.getKey();
+            value = (String) entry.getValue();
 
             if ("operationsVisible".equals(name)) {
                 ((OperationsCompartmentContainer) fig)

Modified: trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java?view=diff&rev=13643&p1=trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java&p2=trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java&r1=13642&r2=13643
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/UmlDiagramRenderer.java	2007-10-07 04:08:40-0700
@@ -225,10 +225,11 @@
     private void setStyleAttributes(Fig fig, Map attributeMap) {
         String name;
         String value;
-        Iterator it = attributeMap.keySet().iterator();
+        Iterator it = attributeMap.entrySet().iterator();
         while (it.hasNext()) {
-            name = (String) it.next();
-            value = (String) attributeMap.get(name);
+            Map.Entry entry = (Map.Entry) it.next();
+            name = (String) entry.getKey();
+            value = (String) entry.getValue();
 
             if ("operationsVisible".equals(name)) {
                 ((OperationsCompartmentContainer) fig)

Modified: trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java?view=diff&rev=13643&p1=trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java&p2=trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java&r1=13642&r2=13643
==============================================================================
--- trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java	(original)
+++ trunk/src_new/org/argouml/uml/generator/ui/ClassGenerationDialog.java	2007-10-07 04:08:40-0700
@@ -357,10 +357,11 @@
                     } // end for (all nodes)
 
                     // generate the files
-                    Iterator nit = nodesPerPath.keySet().iterator();
+                    Iterator nit = nodesPerPath.entrySet().iterator();
                     while (nit.hasNext()) {
-                        String basepath = (String) nit.next();
-                        Set nodeColl = (Set) nodesPerPath.get(basepath);
+                        Map.Entry entry = (Map.Entry) nit.next();
+                        String basepath = (String) entry.getKey();
+                        Set nodeColl = (Set) entry.getValue();
                         // TODO: the last argument (recursive flag) should be a
                         // selectable option
                         Collection files =

Modified: trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java?view=diff&rev=13643&p1=trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java&p2=trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java&r1=13642&r2=13643
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/UMLRadioButtonPanel.java	2007-10-07 04:08:40-0700
@@ -180,8 +180,8 @@
 
     private static List<String[]> toList(Map<String, String> map) {
         List<String[]> list = new ArrayList<String[]>();
-        for (String key : map.keySet()) {
-            list.add(new String[] {key, map.get(key)});
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            list.add(new String[] {entry.getKey(), entry.getValue()});
         }
         return list;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.