svn commit: r569749 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r569749 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java

jonesde
Author: jonesde
Date: Sat Aug 25 18:01:58 2007
New Revision: 569749

URL: http://svn.apache.org/viewvc?rev=569749&view=rev
Log:
Added little method like the addToDoubleInMap to do addToListInMap

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java?rev=569749&r1=569748&r2=569749&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilMisc.java Sat Aug 25 18:01:58 2007
@@ -350,6 +350,15 @@
         return list;
     }
     
+    public static void addToListInMap(Object element, Map theMap, Object listKey) {
+        List theList = (List) theMap.get(listKey);
+        if (theList == null) {
+            theList = FastList.newInstance();
+            theMap.put(listKey, theList);
+        }
+        theList.add(element);
+    }
+    
     public static long toLong(Object value) {
         if (value != null) {
             if (value instanceof Long) {